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
By adding CSS to Custom styles you can force the image to resize in the PDF exports only.
- On the Dashboard, select Appearance then Custom Styles
- At the top of the page, select PDF on the dropdown menu labelled You are currently editing styles for:
- In the Your PDF Styles box, add the CSS shown below and save
- Go to the image in your text and click edit. Under Advanced Options enter “highresimage” into the Image Class CSS field.
- 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;
}