The svg image is part of the XHTML document nested inside a <svg> tag.
When running the application the replaced element factory was called
several times for different elements - div, input, button, table,
e.t.c
but it was never called for the svg element. As a result there was no
image generated in the PDF. But inside the SVG there were some texts
that were rendered in the PDF as a single line - all texts one after
another.
On the net there are many examples for rendering XML+CSS, XHTML, HTML
to PDF. There are also examples for rendering SVG to PDF using Apache
batik, but I could not find example / explanation how to render XHTM/
HTML containing embedded SVG image using the HTML5 <svg> tag to PDF
document.
What is the correct way of rendering mixed content XHTM/HTML + SVG to
PDF document?
It is actually possible?
Is it possible to render the XHTML and the SVG in 2 separate documents
and than merge/insert the document that is the rendered SVG into the
"master" document that represents just the XHTM markup without the SVG
image?
Pete
> I'm not able to access the code at the moment, but I believe that demo
> with SVG generated images using the Java2D image APIs, and the SVG
> Salamander library. If I'm not mistaken, you'd need to generate the
> PDF-compatible images to use as replaced elements inside PDF output.
Yow are right. I am using Apache batik and SvgToPdf example code from
itext website to generate the PDF data.
My problem was that the replaced element factory was never called for the
<svg> tag.
> On Thu, Dec 15, 2011 at 10:02 AM, Peter Brant <peter...@gmail.com>
> wrote:
>> <svg> needs to be a block-level element (for example, display: block
>> or display: inline-block).
>>
>> Pete
>>
Thanks. This solved my problem :) Now my factory is called and the image
painted inside the PDF document :)
Any clue how to solve this?Thanks,Amit