mnelson4 / printmyblog

WordPress Plugin that simplifies printing your entire blog
GNU General Public License v3.0
16 stars 6 forks source link

Set DPI of images in print #203

Open mnelson4 opened 3 years ago

mnelson4 commented 3 years ago

This should be really easy: https://www.princexml.com/doc/images/#images-size

I just need to test it with Adobe Acrobat Pro. https://www.skotechlearn.com/2018/03/simple-tech-tips-to-check-or-find-resolution-of-pdf.html

mnelson4 commented 3 years ago

Yeah img{prince-image-resolution:600dpi;{ does the trick so long as you reset the image height and width to auto on all images. But then images will be crazy big or crazy small unless you specifically set the right sizes on the images themselves. But of course, usually setting DPI to 600 or something crazy will make the images tiny in print (60 and 75 dpi images will be about a sixth of the size in print as compared to on web).

We will probably also want to automatically use the original images instead of the automatically-resized versions used by WP by default (I don't remember when it started doing this by default but it's been a couple versions)... there's a filter to do that by default...

mnelson4 commented 3 years ago

Also we can still use min-height/width and max-height/width and they apply only if the DPI resizing would have reached either limit. So we should definetely set a max width/height of 100% so images don't overflow (especially if images are just too big). But what about a minimum? Setting that will leave the low-res yucky images, but I'm sure some people will want them. Hmmm

mnelson4 commented 3 years ago

disabling image auto-scaling may also be a good idea: https://wpwebdesign.ie/disable-image-scaling-in-wordpress-5-3/