Resizing Oversized Images in Exports

Pressbooks allows you to either upload or import images to your Media Library, and provides some simple, built-in editing tools which allow you to resize, crop, or scale your image.

Resourcces

To learn more about inserting and editing images Pressbooks, review the following guides:

Issue

Larger images may display well in the web book, but cause layout and formatting issues in the PDF export. You man also want an image smaller in the import to keep the PDF file size down and create a print-friendly layout.

Solution

Remember when editing the Custom Styles Sheet, you can customize the Web, PDF, and Ebook versions. If you want the change to occur across all three formats, you will need to copy the code to each drop-down (top).

By adding CSS to Custom styles you can force the image to resize in the PDF exports only.

  1. On the Dashboard, select Appearance then Custom Styles
  2. At the top of the page, select PDF on the dropdown menu labelled You are currently editing styles for:
  3. In the Your PDF Styles box, add the CSS shown below and save
  4. Go to the image in your text and click edit. Under Advanced Options enter “highresimage” into the Image Class CSS field.
  5. You can then adjust the height and width in pixels in the custom CSS to resize the image in the PDF.

Custom CSS:

.highresimage {
width:475px!important;
height:837px!important;
}

 

License

Icon for the Creative Commons Attribution 4.0 International License

Digging Deeper into Pressbooks Visual Design Copyright © 2023 by Erin Fields and Leila Malkin is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book