You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Jamie Browning <ja...@exponent.co.uk> on 2004/12/10 12:50:13 UTC

SVG > PDF Questions

All,

Forgive my ignorance of PDF but I would like to ask a couple of 
high-level questions about the transcoder...

The SVG2PDF transcoder that is included with Batik, this is actually 
produced by the FOP project right?

In what sense is the SVG 'transcoded' into PDF? Is an SVG <circle> 
element converted into a relevant PDF element (I don't think PDF is 
XML)? Or is the SVG image placed as a rasterized bitmap in the PDF? If 
so what format (PNG/TIFF)? What happens to script elements? Is the FOP 
transcoder essentially for static SVG images.

The reason I am asking is because I recently ran Kevin Lindsays' 
svg2pdf.pl script. What it seems to me is that the SVG has been inserted 
as some low-level object, much like using the <object>/<embed> tag in 
HTML. When you view the document in Reader then the SVG Viewer renders 
the SVG and still retains all its interactivity etc. Is this just a 
totally Adobe solution, or could the same thing be achieved by creating 
the PDF through the FOP transcoder?

Once again sorry for my PDF ignorance. But I have a use case where I 
would like to embed a dynamic SVG graph into a predominantly textual PDF 
and still retain the ability to "drill-down" through the data.

This whole thing is a bit confusing anyway, I mean how does printing 
relate to dynamic documents, when print is a static medium?

TIA

Jamie Browning

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


Re: SVG > PDF Questions

Posted by Jamie Browning <ja...@exponent.co.uk>.
Thomas,

Thanks for your prompt and helpful answer. It seems as if there is a 
world of difference between the "open" PDF specifications and what the 
Adobe Reader offers.

Jamie

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


Re: SVG > PDF Questions

Posted by Thomas DeWeese <Th...@Kodak.com>.
Jamie Browning wrote:

> Forgive my ignorance of PDF but I would like to ask a couple of 
> high-level questions about the transcoder...
> 
> The SVG2PDF transcoder that is included with Batik, this is actually 
> produced by the FOP project right?

    Well the PDF part is.  The provide an implementation of the Java
Graphics2D interface that renders to PDF instead of the screen
(or a printer).

> In what sense is the SVG 'transcoded' into PDF? Is an SVG <circle> 
> element converted into a relevant PDF element (I don't think PDF is 
> XML)?

    As much as possible the geometry is converted to PDF primitives.
So an SVG circle would likely become a series of 4 cubic Beziers.
Which isn't 100% accurate but is very close.

> Or is the SVG image placed as a rasterized bitmap in the PDF? 

    For certain features of SVG it isn't possible to do a direct
mapping (in particular anything that has a filter effect applied
will be inserted as a raster).


> If so what format (PNG/TIFF)? 

    I'm not 100% certain, I would guess PNG, but JPEG is also likely.

> What happens to script elements? 

    There is an option to run 'onload' events before transcoding
occurs, but basically script is ignored.  The "open" versions of
PDF are static.

> Is the FOP transcoder essentially for static SVG images.

    Essentially.

> The reason I am asking is because I recently ran Kevin Lindsays' 
> svg2pdf.pl script. What it seems to me is that the SVG has been inserted 
> as some low-level object, much like using the <object>/<embed> tag in 
> HTML. When you view the document in Reader then the SVG Viewer renders 
> the SVG and still retains all its interactivity etc. Is this just a 
> totally Adobe solution, or could the same thing be achieved by creating 
> the PDF through the FOP transcoder?

    This is an Adobe thing (people have reverse engineered some of it)
that basically triggers the Adobe SVG Viewer inside of Acrobat.
It might be possible for Batik to do something similar but this only
works with recent versions of Adobe Acrobat Reader (actually I think
you need a reader extension for this to work).

    There are also lots of complications around externally referenced
content that would make this difficult to make a 'general' solution.

> Once again sorry for my PDF ignorance. But I have a use case where I 
> would like to embed a dynamic SVG graph into a predominantly textual PDF 
> and still retain the ability to "drill-down" through the data.
> 
> This whole thing is a bit confusing anyway, I mean how does printing 
> relate to dynamic documents, when print is a static medium?

    I think you can embed two versions of the "page" and the static
one is used for printing but I don't really know the details.


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