[cl-pdf-devel] Representation of basic PDF objects
Dmitri Ivanov
divanov at aha.ru
Tue Apr 27 11:51:33 UTC 2004
Hello Arthur,
| I have one more question/remark about representing PDF objects.
| CL-PDF seems to represent PDF-strings by Lisp strings, but with
| the PDF-delimiters (left and right parenthesis) included in the
| string. I think that's quite error-prone.
I am afraid, you've got a wrong impression. Parenthesis mostly added only
when writing into *pdf-stream* by means of the def-pdf-op macro. IIRC
pdf-string is an additional function used outside content streams, hence
rather rare.
| I think it's more logical to strip off the PDF-delimiters on input
| and just add them back on output. That way, you can just manipulate
| your Lisp strings any way you like, without having to worry about
| PDF's delimiters. For instance, here's a snippet of CL-PDF:
|
| (setf (content outline)
| (make-instance 'dictionary
| :dict-values `(,@(if parent `(("/Title" . ,(concatenate
| 'string "("
| (title outline) ")"))
|
| that could have been simplified if you just added the delimiters
| on output.
|
| I'd be interested in your opinion about this.
Agree.
| I'm starting to like the PDF specification quite a lot, by the way.
| It's well-written and it seems to have a clean and flexible design.
So did I, though I wish I had not. But that was the only chance to deal with
cl-pdf :-)
--
Sincerely,
Dmitri Ivanov
lisp.ystok.ru
More information about the cl-pdf-devel
mailing list