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

Arthur Lemmens alemmens at xs4all.nl
Mon Apr 26 11:13:45 UTC 2004


Hi,

I've started work on the PDF parser.
My first idea was to use the following mapping from the basic PDF
objects to Lisp objects:
  - true -> :true
  - false -> :false
  - number -> number
  - string -> string
  - name -> symbol in the PDF package
  - array -> vector
  - dictionary -> property list
  - stream -> pdf-stream
  - null -> nil

Mapping names to symbols, dictionaries to property lists
and null to nil would make for a more elegant mapping than
what CL-PDF seems to be using now, I think. CL-PDF seems to
use Lisp strings for names, and :null for NIL.

Using :null instead of NIL means that you would have to
insert some special checks when reading/changing dictionary
values. (Because a :null value in a dictionary should be
equivalent to having to omitting the key from the dictionary.
This is exactly equivalent to having a NIL value in a Lisp
property list.) These checks seem to be missing from CL-PDF
at the moment.

Also, using two separate Lisp types (strings and symbols) for
two separate PDF types (strings and names) seems more elegant
to me than using Lisp strings for both strings and names.

Do you agree with this or am I missing something?

Thanks,

Arthur Lemmens





More information about the cl-pdf-devel mailing list