Forum How do I...?

Embed PDF in PDF

silviobierman
The HTML page I am converting to PDF contains dynamically generated images. I currently generate the images as PNG files and generate <img src=...> tags in the HTML doc.
Although this works the images scale poorly. I can use iText to generate them as PDF files but I do not know how to get Prince to embed the PDF images inside the total PDF document.

Is this in any way possible?

Kind regards,

Silvio Bierman
mikeday
Not at the moment. Can you generate the images as SVG instead?
silviobierman
Yes, I could use Batik to generate SVG instead of PDF. Is that easier to embed?

Kind regards,

Silvio
mikeday
Yes, Prince has support for a subset of SVG, but we don't support loading PDF files for embedding within other PDF files at this time.
silviobierman
I generated the graphs in SVG instead of PNG/PDF format and Prince indeed embeds them quite nicely. Firefox will show the SVG out of the box as well, IE of course being the PITA it usually is...

However, my image generation library uses gradients a lot. FF shows them exactly as they where in PNG format but for some reason in the PDF generated by Prince I get a nice gradient on the background of my graph but the subsequent gradients used in the graph bars are absent. It looks like Prince only draws the first gradient in an SVG image (I know, that sounds stupid).

Is there something I can do about how Prince interprets my SVG?

Kind regards,

Silvio Bierman
mikeday
Some SVG gradients are not supported by Prince yet. Could you send me (mikeday@yeslogic.com) an example file? Perhaps we can add support for them.
silviobierman
Mike,

The SVG examples are in your mailbox. I will watch this topic to keep up.

Regards,

Silvio Bierman