Hi Jan,
   There are many things you can tweak that might make a difference in 
performance, but unsurprisingly there is no '--go-fast' switch.  They depend on 
the content in question, so without a better description of the content than 
"they are complex" it will be hard to help you.

   Can you describe what constitutes the majority of the content?  Do you use 
any of the more advanced features of SVG like filters?

Thomas

On Feb 20, 2012, at 4:25 PM, "Jan Tosovsky" <j.tosov...@tiscali.cz> wrote:

> Dear All,
> 
> in my project I need to convert 2 svg files into a single PDF file.
> 
> 1) The first approach was to wrap SVG files by FO code and generate the PDF
> output via Apache FOP. It works fine, but recently I've found that FOP is
> somehow leaking and does not release objects properly so this solution ends
> very quickly with heap space memory errors.
> 
> 2) The second approach was to use Batik's PDF transcoder to produce two
> separate single page PDF files and merge them using the Apache PDFBox
> library.
> 
> Unfortunately, this solution is very slow, especially the Transcoder's
> transcode method:
> 
> private static byte[] getPDFByteArray(InputStream svgStream) throws
> Exception {
>   Transcoder t = new PDFTranscoder();
>   TranscoderInput input = new TranscoderInput(svgStream);
> 
>   ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
>   BufferedOutputStream outputBuff = new BufferedOutputStream(outputStream);
>   TranscoderOutput output = new TranscoderOutput(outputBuff);
>   t.transcode(input, output);
> 
>   return outputStream.toByteArray();
> }
> 
> While the first approach needs approx 2 seconds to complete the task (SVG
> files are quite complex), the second solution takes approx 8 seconds on my
> computer (transcode method itself 7 seconds).
> 
> Does anybody have any hint how to improve the performance of my code? Are
> there any secret speed up switches?
> 
> Thanks,
> 
> Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to