Forum How do I...?

Handling 2 different image resolutions

clarkeclark
I have 150 catalog pages, each with one image per page. I have both high resolution and low-resolution versions of each file. Hi-res files are 300dpi and lo-res is 72 dpi. The image file names are image-n-low-res.gif and image-n-hi-res.jpg

Can you desribe PrinceXML setup so I can substitute the hi-res for low-res in the PDF output?

Thanks.
mikeday
You could include both images in the content, like this:
<img class="lo" src="image-17-low-res.gif"/>
<img class="hi" src="image-17-hi-res.jpg"/>

Then selectively disable one of them:
/* disable hi-res by default */
img.hi { display: none }

/* disable lo-res and enable hi-res for print output */
@media print {
    img.lo { display: none }
    img.hi { display: inline-block }
}

That's one way to do it, anyway. :)