|Steinar Bang||Apr 21, 2002 3:06 pm|
|Ian Castle||Apr 22, 2002 10:10 am|
|Steinar Bang||Apr 22, 2002 10:24 am|
|Steinar Bang||Apr 22, 2002 10:41 am|
|Bob Stayton||Apr 22, 2002 10:51 am|
|Steinar Bang||Apr 22, 2002 1:40 pm|
|Steinar Bang||Apr 23, 2002 3:11 am|
|Steinar Bang||Apr 23, 2002 3:21 am|
|Jirka Kosek||Apr 23, 2002 9:21 am|
|Bob Stayton||Apr 23, 2002 9:35 am|
|Daniel Veillard||Apr 23, 2002 9:37 am|
|Subject:||Re: DOCBOOK-APPS: scaling images in PDF but not in HTML?|
|From:||Ian Castle (ian....@coldcomfortfarm.net)|
|Date:||Apr 22, 2002 10:10:51 am|
PNG is a bit mapped format. A pixel in the image corresponds to a pixel on the screen when displayed. This means that an image at 640x480 will be physically larger than the same image at 1024x768 (i.e. will take up more of the page width).
PDF attempts to be device independent - so scales the image according to what it thinks the density should be. Ths means that with PDF the image will always be the same size - however, the quality will be a bit strange.
So to get your PDF images to render "correctly" you need to adjust the density of the image (usually, an image will not be created with a density so a default is used (75 dpi IIRC).
You can use the ImageMagick convert command to add a density to an image:
convert -density 150 image.png image.eps eps2png -res 150 image.eps
Will result in image.eps with a density of 150dpi (i.e. it wall be half the size of the original - assuming that 75dpi is the default).
Anyway, you can vary the density until you are happy with the result.
On Sun, 2002-04-21 at 23:07, Steinar Bang wrote:
Platform: Intel PIII, debian testing, Blackdown Java SDK 1.3.1, Saxon 6.4.4, DocBook XML 4.1.2, DocBook-XSL 1.48, Fop-0.20.3rc
Is it possible to scale images in PDF, but not in HTML?
I'm writing a step by step howto with PNG screen shots as a DocBook XML <article>. I'm using a <section> for each screen shot, with a the text accompanying the screen shot in a <para> following the screen shot.
The idea was that if the HTML is formatted into one HTML page per section (I haven't figured out how to do that yet, but I have seen it done), each HTML page will consist of a the <section> <title>, the screen shot, and the text, as well as navigation links (next, prev, up).
The problem is in that the PDF variant of the the same document I get page breaks immediately after the section header, with the screen shot and the text on the next page.
Ie. I get pages consisting of: - a screen shot - the text of the screen shot - the section title for the next screen shot and that's not a very efficient use of the paper.
I could put in <beginpage/> element before each section, and then at least the title header would appear on the same page as the screen shot and the text.
But that would still give me just a single screen shot per page, when the page can easily take two, or three, and have them remain readable.
I could scale the images in the DocBook XML source, but that would cause the images to scale in HTML as well as in PDF, and I would like the images to remain unscaled in HTML.
So we're back to the question at the start: is there a way to make the images scale in PDF, but not in HTML?