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 Jim Guerin <jg...@pasemi.com> on 2006/03/30 01:57:53 UTC

postscript images missing in PDF output

Hi,

I've searched and Googled and tried many iterations of setting parameters but 
I just can't seem to find the answer to this one.

I'm currently using 0.91 beta to output to PDF.  When I open the PDF file all 
of images are missing.  I'm using EPS as sources for images.

I've read on the Apache Fop page that this was a limitation of Acrobat because 
it does not have a built-in postscript interpreter.  Postscript images would 
not show up in the PDF viewer but would print to a postscript printer.  This 
was also the case for 20.5.  So to get around that, I found the work around 
that somebody posted in which you run command line filters, pdftops, then 
ps2pdf, and the images would be present (though you would lose bookmarks in 
20.5).  So I tried this same approach for 0.91 beta and it didn't work; my 
images are still missing.

I checked the compliance page and did not see anything relating to this.  I 
did find a thread on the fop-users that didn't seem to be related that talked 
about setting content-height and content-width to 'scale-to-fit', so I tried 
that also but no luck.  Previously, content-height, content-width, height, 
and width were all set to auto.

Here's the <snip>

<fo:block text-align="center"><fo:block id="serd_fig_tx_term" keep-       
together="auto" keep-with-next="auto" space-before.minimum="0.5em" 
space-before.     optimum="1em" space-before.maximum="2em" 
space-after.minimum="0.5em" space-after.    optimum="1em" 
space-after.maximum="2em"><fo:block font-weight="bold" font-           
size="12pt" hyphenate="false" space-after.minimum="0.4em" 
space-after.optimum="0.    6em" space-after.maximum="0.8em" 
space-before.optimum="1em" space-before.minimum="0. 8em" 
space-before.maximum="1.2em" 
keep-with-next.within-column="always">Figure&#xA0; 1.&#xA0;SERDES Transmitter 
Termination</fo:block><fo:block text-align="center"><fo:  external-graphic 
src="url(images/serdes-tx-term.eps)" width="auto" height="auto"     
content-width="auto" content-height="auto" 
text-align="center"/></fo:block></fo:     block></fo:block>

******

As I stated above, if use this exact same block and use 20.5, then the 
filters, my images will appear.  If I use 0.91 beta, then the filters, no 
images.

My guess is that since 0.91 beta is more strict with interpretation that it 
doesn't like something about this block.  However I didn't see anything in 
the output with the debug switch on (I might have missed it tho!).

I'm at a loss.  Is it something _really_ obvious?

Regards,

Jim




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


Re: displaying images in XSL-FO for Apache Cocoon

Posted by Diego F Guillen <ad...@tpg.com.au>.
Hi Kai,

Thank you very much for the insight. It worked !!!

And the fo's syntax is:
    <fo:external-graphic src="url('images/myimage.gif')"/>
It also works without the url():
    <fo:external-graphic src="images/myimage.gif"/>

Best regards,
    Diego Guillen

Kai Mütz wrote:

>You can configure the FOPSerializer in sitemap.xmap to use a user config
>file where you can set the base directory:
>
><map:serializer logger="sitemap.serializer.fo2pdf"
>mime-type="application/pdf" name="fo2pdf"
>src="org.apache.cocoon.serialization.FOPSerializer">
>      <user-config>WEB-INF/fop-config.xml</user-config>
></map:serializer>
>
>http://xmlgraphics.apache.org/fop/0.20.5/configuration.html
>
>  
>
>>-----Original Message-----
>>From: fop-users-return-19875-kmuetz=web.de@xmlgraphics.apache.org
>>[mailto:fop-users-return-19875-kmuetz=web.de@xmlgraphics.apache.org]On
>>Behalf Of Diego F Guillen
>>Sent: Thursday, March 30, 2006 10:36 AM
>>To: fop-users@xmlgraphics.apache.org
>>Subject: displaying images in XSL-FO for Apache Cocoon
>>
>>
>>Hi all,
>>
>>I have been using Apache Cocoon 2.1.8 (which uses Apache FOP 0.20.5).
>>I have coded xsl-fo and managed to display PDF successfully with:
>>headers, footers, paragraphs, lists, and tables.
>>
>>However, here is where I need your help:
>>I have generated the following xsl-fo for displaying images in PDF,
>>which doesn't seem to work:
>>[I've tried all of the cases below, without results]
>>[I'm omitting the enclosing <fo> tags]
>>
>><fo:external-graphic src="images/myimage.gif"/>
>><fo:external-graphic src="*url(*images/myimage.gif*)*"/>
>><fo:external-graphic src="*file:/*images/myimage.gif"/>
>><fo:external-graphic src="*url(file:/*images/myimage.gif*)*"/>
>><fo:external-graphic src="*../*images/myimage.gif"/>
>><fo:external-graphic src="*url(../*images/myimage.gif*)*"/>
>><fo:external-graphic src="*file:/../*images/myimage.gif"/>
>><fo:external-graphic src="*url(file:/../*images/myimage.gif*)*"/>
>>
>>My project structure is:
>>* test/
>>    sitemap.xmap
>>    content/
>>       testfile.xml  (containing docbook)
>>    images/
>>       myimage.gif
>>    styles/
>>       mydbk2pdf.xsl (containing the code above)
>>
>>My sitemap.xmap contains the following fragments:
>>
>>     <!-- for processing pdf requests -->
>>    <map:match pattern="test/*.pdf">
>>       <map:generate type="file" src="test/content/{1}.xml"/>
>>       <map:transform type="xslt" src="styles/mydbk2pdf.xsl"/>
>>       <map:serialize type="fo2pdf"/>
>>    </map:match>
>>
>>   <!-- for processing images -->
>>    <map:match pattern="images/**.gif">
>>       <map:read src="context://test/images/{1}.gif"
>>mime-type="image/gif"/>
>>    </map:match>
>>
>>Your insight will be much appreciated.
>>I would also appreciate if someone could give me an example that works.
>>
>>Best resgards,
>>    Diego Guillen
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>>For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
>  
>

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


RE: displaying images in XSL-FO for Apache Cocoon

Posted by Kai Mütz <km...@web.de>.
You can configure the FOPSerializer in sitemap.xmap to use a user config
file where you can set the base directory:

<map:serializer logger="sitemap.serializer.fo2pdf"
mime-type="application/pdf" name="fo2pdf"
src="org.apache.cocoon.serialization.FOPSerializer">
      <user-config>WEB-INF/fop-config.xml</user-config>
</map:serializer>

http://xmlgraphics.apache.org/fop/0.20.5/configuration.html

> -----Original Message-----
> From: fop-users-return-19875-kmuetz=web.de@xmlgraphics.apache.org
> [mailto:fop-users-return-19875-kmuetz=web.de@xmlgraphics.apache.org]On
> Behalf Of Diego F Guillen
> Sent: Thursday, March 30, 2006 10:36 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: displaying images in XSL-FO for Apache Cocoon
>
>
> Hi all,
>
> I have been using Apache Cocoon 2.1.8 (which uses Apache FOP 0.20.5).
> I have coded xsl-fo and managed to display PDF successfully with:
> headers, footers, paragraphs, lists, and tables.
>
> However, here is where I need your help:
> I have generated the following xsl-fo for displaying images in PDF,
> which doesn't seem to work:
> [I've tried all of the cases below, without results]
> [I'm omitting the enclosing <fo> tags]
>
> <fo:external-graphic src="images/myimage.gif"/>
> <fo:external-graphic src="*url(*images/myimage.gif*)*"/>
> <fo:external-graphic src="*file:/*images/myimage.gif"/>
> <fo:external-graphic src="*url(file:/*images/myimage.gif*)*"/>
> <fo:external-graphic src="*../*images/myimage.gif"/>
> <fo:external-graphic src="*url(../*images/myimage.gif*)*"/>
> <fo:external-graphic src="*file:/../*images/myimage.gif"/>
> <fo:external-graphic src="*url(file:/../*images/myimage.gif*)*"/>
>
> My project structure is:
> * test/
>     sitemap.xmap
>     content/
>        testfile.xml  (containing docbook)
>     images/
>        myimage.gif
>     styles/
>        mydbk2pdf.xsl (containing the code above)
>
> My sitemap.xmap contains the following fragments:
>
>      <!-- for processing pdf requests -->
>     <map:match pattern="test/*.pdf">
>        <map:generate type="file" src="test/content/{1}.xml"/>
>        <map:transform type="xslt" src="styles/mydbk2pdf.xsl"/>
>        <map:serialize type="fo2pdf"/>
>     </map:match>
>
>    <!-- for processing images -->
>     <map:match pattern="images/**.gif">
>        <map:read src="context://test/images/{1}.gif"
> mime-type="image/gif"/>
>     </map:match>
>
> Your insight will be much appreciated.
> I would also appreciate if someone could give me an example that works.
>
> Best resgards,
>     Diego Guillen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


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


displaying images in XSL-FO for Apache Cocoon

Posted by Diego F Guillen <ad...@tpg.com.au>.
Hi all,

I have been using Apache Cocoon 2.1.8 (which uses Apache FOP 0.20.5).
I have coded xsl-fo and managed to display PDF successfully with:
headers, footers, paragraphs, lists, and tables.

However, here is where I need your help:
I have generated the following xsl-fo for displaying images in PDF, 
which doesn't seem to work:
[I've tried all of the cases below, without results]
[I'm omitting the enclosing <fo> tags]

<fo:external-graphic src="images/myimage.gif"/>
<fo:external-graphic src="*url(*images/myimage.gif*)*"/>
<fo:external-graphic src="*file:/*images/myimage.gif"/>
<fo:external-graphic src="*url(file:/*images/myimage.gif*)*"/>
<fo:external-graphic src="*../*images/myimage.gif"/>
<fo:external-graphic src="*url(../*images/myimage.gif*)*"/>
<fo:external-graphic src="*file:/../*images/myimage.gif"/>
<fo:external-graphic src="*url(file:/../*images/myimage.gif*)*"/>

My project structure is:
* test/
    sitemap.xmap
    content/
       testfile.xml  (containing docbook)
    images/
       myimage.gif
    styles/
       mydbk2pdf.xsl (containing the code above)

My sitemap.xmap contains the following fragments:

     <!-- for processing pdf requests -->
    <map:match pattern="test/*.pdf">
       <map:generate type="file" src="test/content/{1}.xml"/>
       <map:transform type="xslt" src="styles/mydbk2pdf.xsl"/>
       <map:serialize type="fo2pdf"/>
    </map:match>

   <!-- for processing images -->
    <map:match pattern="images/**.gif">
       <map:read src="context://test/images/{1}.gif" mime-type="image/gif"/>
    </map:match>

Your insight will be much appreciated.
I would also appreciate if someone could give me an example that works.

Best resgards,
    Diego Guillen


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


Re: postscript images missing in PDF output

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 30.03.2006 22:53:07 Jim Guerin wrote:
> As a follow-up, does the fact that Adobe has deprecated EPS embedding imply 
> that one should only use SVG if vector graphics are desired for PDF output 
> with FOP?

Yes, exactly.


Jeremias Maerki


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


Re: postscript images missing in PDF output

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I've recently had to fix EPS-embedding in PDF. Somehow it was broken in
FOP Trunk.
http://svn.apache.org/viewcvs?rev=386327&view=rev

So, if you get the source code directory from Subversion your problem
should be fixed. Just note that Adobe has deprecated that feature
beginning with PDF 1.4. It should not be used anymore.

On 30.03.2006 01:57:53 Jim Guerin wrote:
> Hi,
> 
> I've searched and Googled and tried many iterations of setting parameters but 
> I just can't seem to find the answer to this one.
> 
> I'm currently using 0.91 beta to output to PDF.  When I open the PDF file all 
> of images are missing.  I'm using EPS as sources for images.
> 
> I've read on the Apache Fop page that this was a limitation of Acrobat because 
> it does not have a built-in postscript interpreter.  Postscript images would 
> not show up in the PDF viewer but would print to a postscript printer.  This 
> was also the case for 20.5.  So to get around that, I found the work around 
> that somebody posted in which you run command line filters, pdftops, then 
> ps2pdf, and the images would be present (though you would lose bookmarks in 
> 20.5).  So I tried this same approach for 0.91 beta and it didn't work; my 
> images are still missing.
> 
> I checked the compliance page and did not see anything relating to this.  I 
> did find a thread on the fop-users that didn't seem to be related that talked 
> about setting content-height and content-width to 'scale-to-fit', so I tried 
> that also but no luck.  Previously, content-height, content-width, height, 
> and width were all set to auto.
> 
> Here's the <snip>
> 
> <fo:block text-align="center"><fo:block id="serd_fig_tx_term" keep-       
> together="auto" keep-with-next="auto" space-before.minimum="0.5em" 
> space-before.     optimum="1em" space-before.maximum="2em" 
> space-after.minimum="0.5em" space-after.    optimum="1em" 
> space-after.maximum="2em"><fo:block font-weight="bold" font-           
> size="12pt" hyphenate="false" space-after.minimum="0.4em" 
> space-after.optimum="0.    6em" space-after.maximum="0.8em" 
> space-before.optimum="1em" space-before.minimum="0. 8em" 
> space-before.maximum="1.2em" 
> keep-with-next.within-column="always">Figure&#xA0; 1.&#xA0;SERDES Transmitter 
> Termination</fo:block><fo:block text-align="center"><fo:  external-graphic 
> src="url(images/serdes-tx-term.eps)" width="auto" height="auto"     
> content-width="auto" content-height="auto" 
> text-align="center"/></fo:block></fo:     block></fo:block>
> 
> ******
> 
> As I stated above, if use this exact same block and use 20.5, then the 
> filters, my images will appear.  If I use 0.91 beta, then the filters, no 
> images.
> 
> My guess is that since 0.91 beta is more strict with interpretation that it 
> doesn't like something about this block.  However I didn't see anything in 
> the output with the debug switch on (I might have missed it tho!).
> 
> I'm at a loss.  Is it something _really_ obvious?


Jeremias Maerki


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


Re: postscript images missing in PDF output

Posted by Jim Guerin <jg...@pasemi.com>.
Jeremias,

Thanks for your help!

As a follow-up, does the fact that Adobe has deprecated EPS embedding imply 
that one should only use SVG if vector graphics are desired for PDF output 
with FOP?

Jim

> I've recently had to fix EPS-embedding in PDF. Somehow it was broken in
> FOP Trunk.
> http://svn.apache.org/viewcvs?rev=386327&view=rev
> 
> So, if you get the source code directory from Subversion your problem
> should be fixed. Just note that Adobe has deprecated that feature
> beginning with PDF 1.4. It should not be used anymore

On Wednesday 29 March 2006 15:57, Jim Guerin wrote:
> Hi,
>
> I've searched and Googled and tried many iterations of setting parameters
> but I just can't seem to find the answer to this one.
>
> I'm currently using 0.91 beta to output to PDF.  When I open the PDF file
> all of images are missing.  I'm using EPS as sources for images.
>
> I've read on the Apache Fop page that this was a limitation of Acrobat
> because it does not have a built-in postscript interpreter.  Postscript
> images would not show up in the PDF viewer but would print to a postscript
> printer.  This was also the case for 20.5.  So to get around that, I found
> the work around that somebody posted in which you run command line filters,
> pdftops, then ps2pdf, and the images would be present (though you would
> lose bookmarks in 20.5).  So I tried this same approach for 0.91 beta and
> it didn't work; my images are still missing.
>
> I checked the compliance page and did not see anything relating to this.  I
> did find a thread on the fop-users that didn't seem to be related that
> talked about setting content-height and content-width to 'scale-to-fit', so
> I tried that also but no luck.  Previously, content-height, content-width,
> height, and width were all set to auto.
>
> Here's the <snip>
>
> <fo:block text-align="center"><fo:block id="serd_fig_tx_term" keep-
> together="auto" keep-with-next="auto" space-before.minimum="0.5em"
> space-before.     optimum="1em" space-before.maximum="2em"
> space-after.minimum="0.5em" space-after.    optimum="1em"
> space-after.maximum="2em"><fo:block font-weight="bold" font-
> size="12pt" hyphenate="false" space-after.minimum="0.4em"
> space-after.optimum="0.    6em" space-after.maximum="0.8em"
> space-before.optimum="1em" space-before.minimum="0. 8em"
> space-before.maximum="1.2em"
> keep-with-next.within-column="always">Figure&#xA0; 1.&#xA0;SERDES
> Transmitter Termination</fo:block><fo:block text-align="center"><fo: 
> external-graphic src="url(images/serdes-tx-term.eps)" width="auto"
> height="auto"
> content-width="auto" content-height="auto"
> text-align="center"/></fo:block></fo:     block></fo:block>
>
> ******
>
> As I stated above, if use this exact same block and use 20.5, then the
> filters, my images will appear.  If I use 0.91 beta, then the filters, no
> images.
>
> My guess is that since 0.91 beta is more strict with interpretation that it
> doesn't like something about this block.  However I didn't see anything in
> the output with the debug switch on (I might have missed it tho!).
>
> I'm at a loss.  Is it something _really_ obvious?
>
> Regards,
>
> Jim


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