You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Philippe Lavoie <ph...@cactus.ca> on 2003/05/09 19:24:28 UTC
Please help with PDF generation
Hi,
I have a problem which hopefully would be easy for you guys to solve. I don't really know where to ask and if you have a better forum for this question. Please let me know.
I'm trying to embed an SVG file inside a PDF document. I'd use fop, however the client wants nothing to do with Java. I looked at the output of fop, nfop and other programs. I looked at the PDF reference manual for 1.4 and Adobe still doesn't want to read the file I generated.
Can you spot what the problem is? Ghostview says it's something to do with the cross-referencing. But for the life of me, I can't figure out what is wrong and the debug output is really poor on Acrobat or ghostview. Please help me figure out what is wrong with the following pdf file.
%PDF-1.4
%ª«¬Â
1 0 obj
<< /Type /Catalog
Pages 2 0 R
>>
endobj
2 0 obj
<< /Type /Pages
Kid [
5 0 R
]
/Count 1
>>
endobj
3 0 obj
<< /Length 1357
/Type /EmbeddedFile
/Subtype /image#2Fsvg+xml
/Filter null
>>
stream
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="203mm" height="271mm" viewBox="0 0 20300 27100">
<g style="stroke:rgb(0,0,0);fill:none">
<polyline points="10033,15240 1008,15240 813,15200 654,15093 547,14934 508,14740 508,4310 547,4115 654,3956 813,3849 1008,3810 19058,3810 19252,3849 19411,3956 19518,4115 19558,4310 19558,14740 19518,14934 19411,15093 19252,15200 19058,15240 10033,15240" style="fill:none"/>
<polyline points="508,2032 19558,2032" style="fill:none"/>
<polyline points="508,4572 19558,4572" style="fill:none"/>
</g>
<g style="font-family:Verdana;font-size:352;font-weight:700">
<g style="stroke:none;fill:rgb(0,0,0)">
<text x="767" y="4426">PART 1 – POLICYHOLDER/BORROWER/LOAN INFO
</text>
</g>
</g>
<g style="font-family:Verdana;font-size:352;font-weight:400">
<g style="stroke:none;fill:rgb(0,0,0)">
<text x="900" y="5166">CREDIT INSURANCE
</text>
<text x="900" y="5589">POLICY NUMBER
</text>
</g>
<g style="stroke:rgb(0,0,0);fill:none">
<polyline points="4572,5334 9652,5334" style="fill:none"/>
</g>
</g>
<g style="font-family:Verdana;font-size:352;font-weight:700">
<g style="stroke:none;fill:rgb(0,0,0)">
<text x="4577" y="5299">850-1723-8
</text>
</g>
</g>
</svg>
endstream
endobj
4 0 obj
<< /Type /Page
/Parent 2 0 R
/MediaBox [0 0 612 792]
/Content 5 0 R
>>
endobj
5 0 obj
<<
/Type /FileSpec
/F (MySVGFile.svg)
/EF <<
/F 3 0 R
>>
>> endobj
6 0 obj
<<
/F 3 0 R
>> endobj
xref
0 6
0000000000 65535 f
0000000016 00000 n
0000000069 00000 n
0000000140 00000 n
0000001626 00000 n
0000001723 00000 n
0000001828 00000 n
trailer
<< /Size 6
/Root 1 0 R
>>
starxref
1868
%%EOF
Thanks for your help.
Philippe Lavoie
Cactus Commerce Software Developer • Développeur de logiciels
eBusiness. All Business. philippe.lavoie@cactuscommerce.com
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Please help with PDF generation
Posted by Jeremias Maerki <de...@greenmail.ch>.
If that really works I'd be burning for a pointer to a specification
that describes embedding SVG in a PDF. At any rate you can be sure that
GhostScript currently doesn't have an SVG engine built-in so it won't be
able to display the SVG even if there's a proper way to embed SVG in PDF.
The other question would be if Adobe Acrobat Reader supports it, which I
doubt.
On 09.05.2003 20:12:08 Philippe Lavoie wrote:
> I was trying to simplify someone elses efforts. He seems to get away
> with embedding SVG animations inside a PDF document. I'm including the
> example so you can test it. The PDF he uses embeds the SVG inside a
> stream, but it also uses java script and the /SlideShow command.
>
> Perhaps I should just copy that approach. My problem with it was that I
> couldn't print the SVG properly.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: Please help with PDF generation
Posted by Jeremias Maerki <de...@greenmail.ch>.
That almost sounds like you're filling Coke into the tank of your car
and expect it to run. :-)
As far as I know, you can't just embedd an SVG file inside a PDF file.
That's why we have a considerable amount of code in FOP to transform SVG
to PDF commands. It would be WAY easier for you if you just used an
XSL-FO approach with either fo:instream-foreign-object or
fo:external-graphic.
Convince your client to drop his prejudices against Java.
On 09.05.2003 19:24:28 Philippe Lavoie wrote:
> I have a problem which hopefully would be easy for you guys to solve. I
> don't really know where to ask and if you have a better forum for this
> question. Please let me know.
>
> I'm trying to embed an SVG file inside a PDF document. I'd use fop,
> however the client wants nothing to do with Java. I looked at the output
> of fop, nfop and other programs. I looked at the PDF reference manual
> for 1.4 and Adobe still doesn't want to read the file I generated.
>
> Can you spot what the problem is? Ghostview says it's something to do
> with the cross-referencing. But for the life of me, I can't figure out
> what is wrong and the debug output is really poor on Acrobat or
> ghostview. Please help me figure out what is wrong with the following
> pdf file.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
XSL standard: metadata and page numbers
Posted by "J.U. Anderegg" <ha...@bluewin.ch>.
- The XSL standard specifies one page number format: a plain integer
- The XSL standard does not specify anything corresponding to metadata,
structured documents.
Creative extensions may be programmed, but better stick to the XSL standard.
Hansuli Anderegg
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org