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 Florian NOURI <fl...@free.fr> on 2003/10/13 22:45:01 UTC

SVG 2 PDF

Helllo everybody,

I wish convert a SVG file into PDF with FOP. Where i can find a tutorial or
examples ?

Thx


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


Re: SVG 2 PDF

Posted by Jeremias Maerki <de...@greenmail.ch>.
Converting SVG to something (without placing it in a XSL-FO wrapper
first) is normally Batik's job even though the code to generate PDF
comes from the FOP project. Have a look at [1] for converting SVG to PDF
from the command line or an Ant task. If you want to do it in Java, look
at Batik's Transcoder API [2]. There's an example in FOP's sources (only
CVS, not in 0.20.5) under [3].

[1] http://xml.apache.org/batik/svgrasterizer.html
[2] http://xml.apache.org/batik/rasterizerTutorial.html
[3] http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/ExampleSVG2PDF.java?rev=1.2&content-type=text/vnd.viewcvs-markup

> I wish convert a SVG file into PDF with FOP. Where i can find a tutorial or
> examples ?

Jeremias Maerki


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


Re: SVG 2 PDF

Posted by Clay Leeds <cl...@medata.com>.
Andreas L. Delmelle wrote:
>>From: Clay Leeds [mailto:cleeds@medata.com]
>>
>>... I wouldn't mind getting a shell script, macro or regexp that would
>>make the changes necessary to make a c&p in a text editor work. My
>>text-editor has the ability to do many things, including changing
>>linebreaks & feeds. Doubtful that'll matter much, bug would be
>>interesting.
> 
> If you *really* want to try it, apart from the removal of the already
> mentioned newline chars, the xref table at the end of the file (right before
> the trailer) should be modified to reflect the pdf-objects' corresponding
> offsets in bytes from the beginning of the file -- alternately, you have to
> modify the file in such a way that the already existing xref table contains
> these offsets.
> 
> If I'm not mistaken, that should be all that is needed :)
> 
> Good luck!
> 
> Greetz,
> 
> Andreas

Thanks. I doubt I'll take the time to try it, but I'll flag your message 
as a "keeper" in case I need to do something like that in the future.

;-p


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


RE: SVG 2 PDF

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Clay Leeds [mailto:cleeds@medata.com]
>
> ... I wouldn't mind getting a shell script, macro or regexp that would
> make the changes necessary to make a c&p in a text editor work. My
> text-editor has the ability to do many things, including changing
> linebreaks & feeds. Doubtful that'll matter much, bug would be
> interesting.
>

If you *really* want to try it, apart from the removal of the already
mentioned newline chars, the xref table at the end of the file (right before
the trailer) should be modified to reflect the pdf-objects' corresponding
offsets in bytes from the beginning of the file -- alternately, you have to
modify the file in such a way that the already existing xref table contains
these offsets.

If I'm not mistaken, that should be all that is needed :)

Good luck!

Greetz,

Andreas


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


Re: SVG 2 PDF

Posted by Clay Leeds <cl...@medata.com>.
Andreas L. Delmelle wrote:
>>From: Clay Leeds [mailto:cleeds@medata.com]
>>I copied the text to a new file, and saved it as temp.pdf. I then tried
>>to open the file in Acrobat Reader, but it complained and gave an error.
>>It was apparently unreadable by Acrobat.
> 
> Sorry to disappoint you, but it will take a little more than just a c&p in a
> text editor to make this readable by Acrobat. :)
> 
> Don't know if you have ever opened a typical pdf in a text editor, but you
> will notice, for instance, that newline characters never appear inside the
> streams. Outside the streams they don't seem to matter that much and are
> only added for readability of the code.
> 
> By mailing that 'code snippet' then copying it into the text editor, some of
> these newlines inevitably get inserted, so it's best for the original poster
> to repeat this experiment with the original 'text'...
> 
> Greetz,
> 
> Andreas

I figured that might be a possibility. But I thought it might be worth a 
try. I wouldn't mind getting a shell script, macro or regexp that would 
make the changes necessary to make a c&p in a text editor work. My 
text-editor has the ability to do many things, including changing 
linebreaks & feeds. Doubtful that'll matter much, bug would be interesting.

Thanks for the heads up!

;-p


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


RE: SVG 2 PDF

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Clay Leeds [mailto:cleeds@medata.com]
>
> I copied the text to a new file, and saved it as temp.pdf. I then tried
> to open the file in Acrobat Reader, but it complained and gave an error.
> It was apparently unreadable by Acrobat.
>

Sorry to disappoint you, but it will take a little more than just a c&p in a
text editor to make this readable by Acrobat. :)

Don't know if you have ever opened a typical pdf in a text editor, but you
will notice, for instance, that newline characters never appear inside the
streams. Outside the streams they don't seem to matter that much and are
only added for readability of the code.

By mailing that 'code snippet' then copying it into the text editor, some of
these newlines inevitably get inserted, so it's best for the original poster
to repeat this experiment with the original 'text'...

Greetz,

Andreas


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


Re: SVG 2 PDF

Posted by Clay Leeds <cl...@medata.com>.
J.Pietschmann wrote:
> Florian NOURI wrote:
>> i tested .fo files. fo files convert svg2pdf. But when i use external.fo
>> file with cocoon, i have a text as this :
>>
>> %PDF-1.3
> 
> ...
> This looks like PDF. Why do you think it's "text"? Does
> Acrobat Reader complain?
> 
> J.Pietschmann

I copied the text to a new file, and saved it as temp.pdf. I then tried 
to open the file in Acrobat Reader, but it complained and gave an error. 
It was apparently unreadable by Acrobat.

Web Maestro Clay


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


Re: SVG 2 PDF

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Florian NOURI wrote:

> i tested .fo files. fo files convert svg2pdf. But when i use external.fo
> file with cocoon, i have a text as this :
> 
> %PDF-1.3
...
This looks like PDF. Why do you think it's "text"? Does
Acrobat Reader complain?

J.Pietschmann


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


Re: SVG 2 PDF

Posted by Florian NOURI <fl...@free.fr>.
i tested .fo files. fo files convert svg2pdf. But when i use external.fo
file with cocoon, i have a text as this :

%PDF-1.3 %???? 4 0 obj << /Type /Info /Producer (FOP 0.20.5) >> endobj 5 0
obj << /Length 283 /Filter [ /ASCII85Decode /FlateDecode ] >> stream
Gas2D6#-NV&;BTK'm%klj3/j>`+qXH]i6]X+s*%-X+K#hFf"fhS(93eZq([P1[r,H2pYf(jpFXP"
Q'L_rb@"g'a0mG5uEeEC'rOd[(6A^@5XLEqp;b$@15qcFkJTT^;#V8%K86V#cP9(#)GY2*.]C`NM
7q5R:9QR3*5Y1&<>O;%I7 endstream endobj 6 0 obj << /Type /Page /Parent 1 0 R
/MediaBox [ 0 0 595 842 ] /Resources 3 0 R /Contents 5 0 R >> endobj 7 0 obj
<< /Length 766 /Filter [ /ASCII85Decode /FlateDecode ] >> stream
Gb!#Z9okbt&A@ZcI,#^m`F&f$>?BNZgJb/I?Fi9Z_ur_@VjMl)f,(7aO4h$7g)_^r2L%@UhO>#so
AIm*(m,)Z-ng2aXTF*krZR(eR#sC$;hj=kTY*Qtn"*P2lK+o,UfK;D%HS[XF#'1[9c:e#@%(0Fbg
:d&B)UDpV(OZc:n<#E._PohN,F=)M*5e.[/f*,C"L%ph/HrWT>/&=S]_)+>l](HS\Ite44,NaK.s
bb].%;C:97-WLbh]`Y*)3WS,lTk-q,Xc+dViX`^g9'F;5(ge.4o?pT'U`qj[,S9C11TU/mVYOkP_
6L;\\bh(\+tn!l'P@U;tD60gt[V1OfP<]AV[n;HqR,\quga\lL*?GQ5S2acPD0foo3f1,cnd"egN
!'nM_LQds+osrNLrN1hjg$k8*9h$`="9n:T)%S]1o+j^s/,]gi5"Usb-`L'fYJEpG+$DaJ_=ukdn
`m%ZV;GWoC(eogAWGN\1/%0s*M/%qn_mY.V7f$hR.@PAd^Q5r3*Euac3'$qZM^'S=;5=Z!K'?f^@
r1$pR+d+.N-1XsO4cN#$5]qhB6#XOUFEo\HYFXI[C&VOZEKGWsA;h\O.*Sunh]S\]dJ/$?'5]R!E
-T+H?]cTsp#tDHTdLqgoE"m~> endstream endobj 8 0 obj << /Type /Page /Parent 1
0 R /MediaBox [ 0 0 595 842 ] /Resources 3 0 R /Contents 7 0 R >> endobj 9 0
obj << /Type /Font /Subtype /Type1 /Name /F3 /BaseFont /Helvetica-Bold
/Encoding /WinAnsiEncoding >> endobj 10 0 obj << /Type /Font /Subtype /Type1
/Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 1 0 obj
<< /Type /Pages /Count 2 /Kids [6 0 R 8 0 R ] >> endobj 2 0 obj << /Type
/Catalog /Pages 1 0 R >> endobj 3 0 obj << /Font << /F3 9 0 R /F1 10 0 R >>
/ProcSet [ /PDF /ImageC /Text ] >> endobj xref 0 11 0000000000 65535 f
0000001734 00000 n 0000001798 00000 n 0000001848 00000 n 0000000015 00000 n
0000000071 00000 n 0000000445 00000 n 0000000551 00000 n 0000001408 00000 n
0000001514 00000 n 0000001626 00000 n trailer << /Size 11 /Root 2 0 R /Info
4 0 R >> startxref 1937 %%EOF


instead of PDF file. Why ?
----- Original Message ----- 
From: "Clay Leeds" <cl...@medata.com>
To: <fo...@xml.apache.org>
Sent: Monday, October 13, 2003 10:53 PM
Subject: Re: SVG 2 PDF


> Florian NOURI wrote:
> > Helllo everybody,
> >
> > I wish convert a SVG file into PDF with FOP. Where i can find a tutorial
or
> > examples ?
> >
> > Thx
>
> Have you checked here:
>
>    "fop-0.20.5/examples/fo/svg"
>
> (svg examples are installed with FOP)
>
> Hope this helps!
>
> Web Maestro Clay
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>


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


Re: SVG 2 PDF

Posted by Clay Leeds <cl...@medata.com>.
Florian NOURI wrote:
> Helllo everybody,
> 
> I wish convert a SVG file into PDF with FOP. Where i can find a tutorial or
> examples ?
> 
> Thx

Have you checked here:

   "fop-0.20.5/examples/fo/svg"

(svg examples are installed with FOP)

Hope this helps!

Web Maestro Clay


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