[cl-pdf-devel] Embedding several PDF files in one document

Marc Battyani marc.battyani at fractalconcept.com
Fri Apr 23 10:42:46 UTC 2004


"Arthur Lemmens" <alemmens at xs4all.nl>

> I have no experience with CL-PDF yet, and I've only just
> started reading the PDF standard.
>
> I've written a simple web site that lets users registrate
> for a conference. Users can submit abstracts and papers
> in PDF-format. My client wants to automatically generate
> an abstract book that contains all the submitted abstracts
> and starts with some kind of contents overview with the names
> of the authors, titles of the abstracts, etc.

If you want formatted output you should use cl-typesetting, cl-pdf is only
the rendering layer.

> This means I would have to somehow embed all the submitted
> PDF-documents and generate a new document. I've been browsing
> through the standard, but I don't think it explicitly mentions
> embedding other PDF files. I suppose it should be possible, using
> constructs like File Attachment annotations (6.6.14), Destinations
> (7.3) and File Specifications (7.4.2), but I don't see the big
> picture yet.

If you want to include a pdf page, what you need is a Form XObject. But if
you want to merge several pages then you probably need to parse the pdf to
extract the pages.

> I would appreciate some hints to get me started. Do you think
> it is possible at all? Is it possible with the current version
> of CL-PDF, or should I write some extensions? (I'll contribute
> any CL-PDF extensions that I may need to write, of course.) Should
> I be looking at File Attachments and File Specifications, or is
> there something else I'm missing?

I don't think that file attachements are usable for this.

There are several tools that merge pdf files. May be it's a good idea to
look at them to see what they do. For instance here is one in C++:
http://thierry.schmit.free.fr/dev/mbtPdfAsm/enMbtPdfAsm2.html
You can generate a very simple pdf files (just a hello world) with cl-pdf
and then merge them with such a tool to see what is in the resulting pdf.

You will need to parse the pdf files. I have a crude pdf file parser but as
I didn't used it for some time it probably need some work to be operational
again. I didn't published it because it's not portable as it uses the parser
generator of Lispworks. The lexer should also be replaced by a cl-ppcre one.

Marc





More information about the cl-pdf-devel mailing list