Laisne Stéphane <S.Laisne <at> lectra.com> writes:

> 
> In order to display SVG file in PDF, I create
> a specific renderer, using batik, and I’ve a big problem with the Itext
> PdfGraphics2D.

I've done the same thing recently in Cardiff's LiquidOffice.  We rewrote the
entire PDF exporter in Java using iText, and one of the things we do is render
SVG for our more complex field backgrounds (comb fields, rounded edges, and more
importantly: pattern fills).
 
> When I want to display a SVG with vector-based
> pattern, the PdfGraphics2D can’t render it with good instruction and the
> process time is too long (30min for a simple svg).

Java's Graphics2D system forces all patterns into a raster image format to be
tiled.  That's not up to iText, it's one of Sun's design decisions. This results
in some rather painful looking patterns in iText and, it would appear, rendering
time issues.

If you can find a way to remove the pattern and replace it with repeated vector
art, I think you'll find the problem solved.  I also wonder at the size of the
pattern itself.  I'd think a smaller tile wouldn't take so long to render the
pattern, leading me to believe your pattern may be the size of your entire
background... or even larger.
 
I was looking into subclassing Graphics2D's java.awt.PaintContext and
java.awt.image.Raster classes to pass around iText's PdfPatternPainter and using
that within the bounds of PdfGraphics2D, but abandoned it as "not worth the
effort".  Patterns are used very rarely within our product, and I hadn't run
into your 30 minute rendering time problem.

> Best regards
> 
>  
> 
> Stéphane
> LAISNE
> 
> FIP Tools 
> 
> Research
> and Development
> 
> Lectra / Cestas
> 
> Tel.: +33 (0)5 57 97 35 44
> 


--Mark Storer
  PDF Guy
  Cardiff.com

#include <disclaimer>
typedef std::disclaimer<Cardiff> Discard;


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to