You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jussi Paju <ju...@iki.fi> on 2010/03/16 23:23:41 UTC

SVG as Form Xobjects?

Hi all,

Before I finally switch back to PHP-based PDF generators and return using
FOP+Barcode4j only to generate vector barcodes to documents generated elsewhere,
I would just like to ask confirmation for this:

Is it really so that at the moment FOP does not handle imported SVG's even in
static areas any other way than re-importing the file again for every page
generated?

I just generated about 900 invoice pages that all share same 160Kb SVG as their
background and was stunned about the size of the resulting PDF - You do the
math. ;) When doing this properly, the file shouldn't have been more than few
megabytes maximum instead of 100+.


Br,
Jussi Paju



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


Re: SVG as Form Xobjects?

Posted by Jussi Paju <ju...@iki.fi>.
Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> Hi Jussi
> 
> Yes, at the moment FOP doesn't support generating SVG graphics as Form
> XObjects. So far noone seems to have found it important enough to invest
> time in this.
> ....
> For your case, you can do a work-around: Convert the SVG to PDF with the
> PDFTranscoder and then use my PDF plug-in [1] to include the PDF which
> does create Form XObjects for the imported pages. Or you can simply
> convert the SVG to a bitmap.
> 
> [1] http://www.jeremias-maerki.ch/development/fop/index.html

Hi Jeremias

Thanks for your reply, the imported filetype is irrelevant as long as the
contents are loaded and remain in vector format (with FPDF+plugins I've imported
layouts straight from PDF's).

I saw mention about your plugin in some earlier post while I searched for Form
XObjects with FOP, but couldn't find the actual plugin even with Google (tried
to find "pdf-in-pdf" as it was referenced) so I figured that it might not have
been publicly available/usable.

I'll check if that could solve my problem without huge fuss. (Altough now that I
looked, it seems that in order to use newer release of plugin, I'd have to drop
0.94 from Debian package and install 0.95 manually.)

Thanks again. :)

/Jussi





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


Re: SVG as Form Xobjects?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Jussi

Yes, at the moment FOP doesn't support generating SVG graphics as Form
XObjects. So far noone seems to have found it important enough to invest
time in this.

Doing that is perfectly feasible but involves at least one trouble
spot:
- SVG links result in link annotations in PDF and they require absolute
coordinates for the page they are on. They cannot be attached to a Form
XObject. So if you have the same SVG multiple times in a PDF document,
the link annotations would still have to be generated again in the right
spot for each link. Doable but complicates matters obviously.

If generating a Form XObject makes sense for SVG in an
fo:instream-foreign-object, I'm not sure.

For your case, you can do a work-around: Convert the SVG to PDF with the
PDFTranscoder and then use my PDF plug-in [1] to include the PDF which
does create Form XObjects for the imported pages. Or you can simply
convert the SVG to a bitmap.

[1] http://www.jeremias-maerki.ch/development/fop/index.html


On 16.03.2010 23:23:41 Jussi Paju wrote:
> Hi all,
> 
> Before I finally switch back to PHP-based PDF generators and return using
> FOP+Barcode4j only to generate vector barcodes to documents generated elsewhere,
> I would just like to ask confirmation for this:
> 
> Is it really so that at the moment FOP does not handle imported SVG's even in
> static areas any other way than re-importing the file again for every page
> generated?
> 
> I just generated about 900 invoice pages that all share same 160Kb SVG as their
> background and was stunned about the size of the resulting PDF - You do the
> math. ;) When doing this properly, the file shouldn't have been more than few
> megabytes maximum instead of 100+.
> 
> 
> Br,
> Jussi Paju



Jeremias Maerki


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