> On 10 Aug 2015, at 05:58, Kirk, Kenneth <[email protected]> wrote: > > I have a situation that maybe someone has already solved in a more efficient > manner. When converting a tiff image to PDF I use the drawImage method of > the PDPageContentStream. The tiff image has a resolution of 200 DPI which is > 1700x2200. When PDFRenderer renders this image from the resulting PDF page > it does so at the PDF default of 72 DPI which logically translates to page 23 > inches by 30 inches when applied to the original iamge size of 1700x2200. > Since I don't know after the fact what DPI a image object on PDF page was > drawn at I came up with down scaling the image at PDF creation time to 72 > DPI. I'm sure there must a better way one of you computer science PHDs have > come up with. >
You can draw the image with a scale of 72 / 200, in other words: double dpi = 200; // you’ll want to fetch this from the tiff content.drawImage(image, x, y, image.getWidth() * 72 / dpi, image.getHeight() * 72 / dpi; — John --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

