[cl-pdf-devel] Representation of basic PDF objects

Marc Battyani marc.battyani at fractalconcept.com
Mon Apr 26 19:21:15 UTC 2004


"Arthur Lemmens" <alemmens at xs4all.nl> wrote:
> Marc Battyani wrote:

> The grammar is simple enough that I've decided to skip Lispworks'
> parser generator and just write some extra parse functions 'by hand'.
> So the result should be portable.

Good point.

...
> You look at this from the point of view of generating PDF, but at the
> moment I'm looking at it with the idea of parsing and editing existing
> PDF documents. That gives a slightly different perspective on stuff
> like this. As a matter of fact, at the moment I'm even considering the
> idea of (semi-automatically) defining a CLOS class for each kind of PDF
> object with separate slots for corresponding to each dictionary key.
> That way, you could edit any element of the document by using the right
> (setf slot-value). But this may be overkill, and it may take more time
> than I can spend right now.

Well IMO what you want to do is open, parse, draw on existing pages, add new
pages then write and close it. At least it was what I needed. So you don't
need to parse all. In the parser I've sent to you, I keep the pdf streams as
byte sequences without looking at what is inside. It's much faster that way
;-)

> > It has probably never be needed so far. (There is no "null" in the
> > cl-pdf sources.)
>
> No, but there may be in existing documents ;-)

Yes but IMO you should just read and write them in the same way (strings)
rather than read, convert to symbol then convert to string, write. Well
again this is if you just want to draw on an existing pdf. If you want to
analyse a pdf then it's another story.

> > No! (I mean I don't agree ;-)
>
> OK, I get the message ;-)
> Thanks for your feedback.

Sorry, but I replied to you just after reading the CLISP developpers replies
about an ambiguous feature of LOOP (cf. the cl-typesetting mailing list for
details) so I was rather upset :(

Marc





More information about the cl-pdf-devel mailing list