xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: To convert any image / doc to pdf using FOP
Date Fri, 22 Feb 2008 14:12:19 GMT
First of all, let's make it clear that Apache FOP is an XSL-FO
implementation, i.e. it expected XSL-FO as input.

Converting an image to PDF is not directly possible with FOP 0.94. It
will be in 0.95 (only from the command-line or with special Java code) as
a side-effect of an additional feature that was added. But this will
never be FOP's primary function.

If you want to convert an image into a PDF, write a minimal XSL-FO
document and use fo:external-graphic to embed the image. Here's such a
minimal FO document:

<?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="A4" page-height="29.7cm" page-width="21cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block line-height="1.0" font-size="0pt">
        <fo:external-graphic src="images/someimage.png"/>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>


On 21.02.2008 21:59:03 myforums2008 wrote:
> 
> I have tried converting an image to pdf. But it says there was an error in
> opening this document, when I try to open the document. Please let me know
> if you know of any solution.
> 
> Thanks,
> Regards,
> Reddy
> -- 
> View this message in context: http://www.nabble.com/To-convert-any-image---doc-to-pdf-using-FOP-tp15618950p15618950.html
> Sent from the FOP - Users mailing list archive at Nabble.com.


Jeremias Maerki


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


Mime
View raw message