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 Michael Woinoski <mi...@ulster.net> on 2001/09/18 18:05:46 UTC

Programmatically creating PDF files that reference an external image

I need to generate pdf from a Java servlet for archiving as well as
viewing in a web browser. The servlet will grab info from a database and
create pdf with a scanned form as a background image. The image will be
the same for all documents. The generated pdf files need to be as small
as possible, since we'll be storing a large number of them.

FO's "external-graphic" tag gives me what we need, except (in FOP, at
least) the image is embedded in the pdf file, resulting in a large file:
    <fo:block-container position="absolute" left="0.0in" top="0.0in"
width="8.5in" height="11.0in">
    	<fo:external-graphic src="pageSizeImage.jpg"/>
    </fo:block-container>
    <fo:block-container position="absolute" left="5.3in" top="1.85in"
width="1.0in" height="0.2in">
    	<fo:block font-size="10pt" font-family="monospace">
    	    Hello World
    	</fo:block>
    </fo:block-container>
I'm looking for something that will keep the image external to the pdf.

I know that pdf 1.3 supports references to external files, so I thought
that instead of using FO, I could simply generate pdf directly. However,
the sample files in the pdf spec appendix G have no examples that show
how to reference external files.

I'm looking for a sample PDF file in plain ASCII that references an
external jpeg image and superimposes text strings on the image.

I'm not committed to this approach, so I'd be willing to try something
different (creating a pdf template from the image and then merging it
with the text, using a pdf form, etc.) But the solution needs to be
something that can be executed dynamically without human intervention,
so any solution that requires using Acrobat or clicking a button in a
pdf form is not an option.

Thanks in advance,
Mike
	
-- 

Mike Woinoski                      Pine Needle Consulting
mailto:michaelw@ulster.net

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