[My apologies if this posts twice -- I sent it the first time from an
unsubscribed email address].

Mork0075 wrote:

> My next issue is, that i want to create a multi page pdf file. Is this 
> possible with batik? Can you give me a hint please how to do this?
> 
> The scenario is the same, i have multiple <svg... strings where i want 
> to print the first one one the first A4 page, the second on the second
> A4 of the pdf and so.
> 
> Thanks in advance :)

One option is to use the FOray Graphic package, which wraps Batik and
provides a method to do part of what you are talking about:
http://www.foray.org/module/graphic/

Here is a link to the aXSL Graphic API javadocs, which is the basic API used
by FOray ...
http://www.axsl.org/api/java/0.2/index.html?org/axsl/graphic/package-summary
.html

See SvgGraphic.drawPdfStreamContent for the method you need.

A couple of caveats:
1. You'll see two dependencies there on aXSL Font, one in the method in
GraphicPdfContext, the other is the FontConsumer instance. A separate font
system is needed because Batik uses AWT fonts, and there is no way to get to
the content of an AWT font to embed it into your PDF. So the aXSL Font
implementation kind of wraps both the physical font file and the AWT font
created from it, allowing it to work in both worlds. If you don't have fonts
in your PDF and don't want to go to the trouble of using an aXSL Font
implementation, we may need to do a little work to avoid that overhead.
2. FOray is right on the cusp of a release, so the implementation of the API
above is not released ATM. If you wanted to use it right now, you would need
to build FOray. However, I hope to have the FOray release done within the
next week.
3. This package just dumps the PDF commands into an OutputStream that you
give it. You will need something to manage the rest of the PDF creation.
PDFBox and FOray PDF (and probably others) can both do that, but that is a
topic that is way too big to discuss here.

If you want to pursue this further, inquire on the FOray support mailing
list, and I'll be glad to help you there, either with FOray Graphic or FOray
PDF:
https://lists.sourceforge.net/lists/listinfo/foray-support

Victor Mote


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to