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 Alexios Giotis <al...@gmail.com> on 2013/05/22 16:06:52 UTC
EPS file is repeated in every page even though optimize-resources=true
Hi,
I have a 4MB encapsulated postscript file that needs to be set as the background of every page. The XSL:FO for testing with FOP 1.0 is [1]. The problem is that the contents of the EPS file are repeated in every page, even though fop.xconf.xml has:
<renderer mime="application/postscript">
<optimize-resources>true</optimize-resources>
</renderer>
Changing "my.eps" to "my.jpg" which is a JPEG file, works as expected. By looking in the code, it seems that there is no supported ImageFlavor for form creation, in other words
org.apache.fop.render.ps.PSImageUtils#isImageInlined always returns true for EPS images.
Anybody knows if this is just not implemented or if this is a limitation of postscript ? If this is not a postscript limitation, any example of how this could be done ? I already looked in the short EPSF_Spec [2] and some suggestions like [3] but could not create a valid postscript file.
Thank you,
Alexios Giotis
[1]
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4"
page-height="29.7cm" page-width="21cm" margin-top="0cm"
margin-bottom="0cm" margin-left="0cm" margin-right="0cm">
<fo:region-body background-repeat="no-repeat"
background-image="file:/Users/alex//tdesk/my.eps" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:flow flow-name="xsl-region-body">
<fo:block break-after="page" margin-top="9cm">Page 1</fo:block>
<fo:block break-after="page" margin-top="9cm">Page 2</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
[2] http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
[3] http://stackoverflow.com/questions/9820646/overlay-two-postscript-files-command-line-approach
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: EPS file is repeated in every page even though optimize-resources=true
Posted by Alexios Giotis <al...@gmail.com>.
Answering my own question, this is possible using forms (PostScript Language Reference Manual, section 4.7) and FOP already uses them with JPEG images and optimize-resources=true.
On 22 May 2013, at 17:06, Alexios Giotis <al...@gmail.com> wrote:
> Hi,
>
> I have a 4MB encapsulated postscript file that needs to be set as the background of every page. The XSL:FO for testing with FOP 1.0 is [1]. The problem is that the contents of the EPS file are repeated in every page, even though fop.xconf.xml has:
> <renderer mime="application/postscript">
> <optimize-resources>true</optimize-resources>
> </renderer>
>
> Changing "my.eps" to "my.jpg" which is a JPEG file, works as expected. By looking in the code, it seems that there is no supported ImageFlavor for form creation, in other words
> org.apache.fop.render.ps.PSImageUtils#isImageInlined always returns true for EPS images.
>
>
> Anybody knows if this is just not implemented or if this is a limitation of postscript ? If this is not a postscript limitation, any example of how this could be done ? I already looked in the short EPSF_Spec [2] and some suggestions like [3] but could not create a valid postscript file.
>
>
> Thank you,
> Alexios Giotis
>
>
>
>
> [1]
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="simpleA4"
> page-height="29.7cm" page-width="21cm" margin-top="0cm"
> margin-bottom="0cm" margin-left="0cm" margin-right="0cm">
> <fo:region-body background-repeat="no-repeat"
> background-image="file:/Users/alex//tdesk/my.eps" />
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="simpleA4">
> <fo:flow flow-name="xsl-region-body">
> <fo:block break-after="page" margin-top="9cm">Page 1</fo:block>
> <fo:block break-after="page" margin-top="9cm">Page 2</fo:block>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
>
> [2] http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
> [3] http://stackoverflow.com/questions/9820646/overlay-two-postscript-files-command-line-approach
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org