xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject RE: Printing Multi-page document
Date Mon, 19 Aug 2002 13:24:58 GMT
>>>>> "YG" == Yanick Gaudet <YGaudet@dinmar.com> writes:

YG> the AOI is propably the best option. I can just loop through the
YG> pages.  How would I find the rectangle for the page to print?

    Parse and understand the attributes on the outermost SVG :)

    Roughly speaking if it has a viewBox attribute then that will give
the bounds of the image to render.  So then you can just divide w/h by
pages across/down (probably paying attention to the aspect ratio in
the process) and add in the viewbox's x/y.

    If it just has width/height attributes then you may need to deal
with units, but in the end it's the same as above except x/y are
always zero.

    Once again all this stuff is much easier inside the
PrintTranscoder since it has parsed and understood all the attributes
and so all the information is immediately available and it is much
more likely to be correct (there are cases where the outermost svg has
no w/h or viewbox in which case you want to use the bounding box of
the contents of the SVG which would essentially require you to build
the GVT tree to get)

    I think your time would be better spend adding a Multi-Page hint
to the PrintTranscoder directly, this is where the functionality
belongs, plus you would be able to give something back to the
community. :)

   Anyway, good luck!

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message