[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Insert PDF file

Subject: Re: Insert PDF file
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Tue, 24 Sep 2002 09:38:49 -0500
insert pdf into email
> > Eric.Reiter@xxxxx wrote:
> > > I have a XML file with a tag <doc>str.pdf</doc>, in which
> > srt.pdf is a file.
> > >
> > > When i transform this XML into PDF (with FOP), i would that the
> > > <doc>str.pdf</doc> would be replaced by the PDF file str.pdf.
> > >
> > > How can i do that?

I think you can do this by converting the PDF into a full-page EPS and
including that, but that would definitely require either an outside
process or an extension function to do it as part of the XSLT process. I
haven't experimented with this, but I'm sure it's possible--worst case
you would use Acrobat to print the pages you want back to Postscript and
then use some utility to make those pages into EPS files--an EPS file is
just normal Postscript with a bit of encapsulation around it so it can
be placed in the context of other Postscript data. The EPS syntax is
well documented in the Acrobat specs (available from the Adobe site).
[For example, it only took me a little while (a couple of hours) to
write Java code that can parse out or add a TIFF image header to an EPS
file (and most of that was remembering how to do byte-stream I/O in Java
:-).]

But it's definitely not possible to simply concatenate PDFs
together--the internal format of PDFs depends entirely on tables of byte
offsets. But, it's not too hard to write code that will combine pages
from different PDFs to make a new one, but that would be after the fact.

I suppose another solution would be to write out place-holder pages in
the main PDF that could be interpreted as references to the included PDF
to be included by a post-process. The post process could then replace
the placeholder pages with the included pages--the only issue there
would be fonts--the included PDFs might require fonts that aren't
required by the main PDF, but that's solvable as well.

See the PJ library (www.etymon.com) for an open-source Java library that
enables this sort of PDF processing. Of course, you can also use the
Adobe PDF library if you have a license for it.

Cheers,

Eliot
-- 
W. Eliot Kimber, eliot@xxxxxxxxxx
Consultant, ISOGEN International

1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.