atom feed11 messages in org.oasis-open.lists.docbook-appsRe: DOCBOOK-APPS: scaling images in P...
FromSent OnAttachments
Steinar BangApr 21, 2002 3:06 pm 
Ian CastleApr 22, 2002 10:10 am 
Steinar BangApr 22, 2002 10:24 am 
Steinar BangApr 22, 2002 10:41 am 
Bob StaytonApr 22, 2002 10:51 am 
Steinar BangApr 22, 2002 1:40 pm 
Steinar BangApr 23, 2002 3:11 am 
Steinar BangApr 23, 2002 3:21 am 
Jirka KosekApr 23, 2002 9:21 am 
Bob StaytonApr 23, 2002 9:35 am 
Daniel VeillardApr 23, 2002 9:37 am 
Subject:Re: DOCBOOK-APPS: scaling images in PDF but not in HTML?
From:Bob Stayton (bo@caldera.com)
Date:Apr 22, 2002 10:51:12 am
List:org.oasis-open.lists.docbook-apps

On Sun, Apr 21, 2002 at 08:50:38PM +0200, 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?

You might try putting two imageobject elements inside a mediaobject inside your screenshot, and assign an appropriate role attribute to each imageobject, such as "html" or "pdf". The imagedata element in each imageobject could have different attributes for scaling the same graphic. Then you could use the profiling stylesheet as a preprocessor to select which imageobject is to be used before passing it to the html or fo stylesheet. It is a bit cumbersome, but it should work.