[cl-typesetting-devel] PATCH: 'creator' invalid syntax

Klaus Weidner kw at w-m-p.com
Mon Nov 8 23:15:07 UTC 2004


On Mon, Nov 08, 2004 at 04:38:24PM -0600, Klaus Weidner wrote:
> I'm currently looking into a weird effect, the PDF files generated by
> current cl-pdf versions are getting rejected as invalid by the "pdftk"
> tool. Older versions used to work fine. I'll try to track down what the
> difference is.

Found it, the "creator" property was being written in invalid syntax (key
and value need to alternate):

	Was:
	<< /Creator cl-pdf (cl-pdf 2.03) >>
	should be:
	<< /Creator (cl-pdf 2.03) >>

Acroread also complains when trying to view the document properties, so
it's not just pdftk that was finicky.

It was caused by a misplaced ~a in a format string. The attached patch
fixes it, and also sets the default "creator" entry to include the version
number. This permits users to override the "creator" value and not be
forced to always have the version number appended, which I assume was not
the intention.

BTW, Marc, what's your preferred format for patches? Are MIME attachments
ok or would you prefer inline patches? And would you prefer the patches
to be split into separate files whenever possible or are combined patches
ok as long as they are reasonably simple? A simple "svn diff" is easiest
for me but I can split them up in case I'm working on multiple things in
parallel.

-Klaus
-------------- next part --------------
Index: pdf.lisp
===================================================================
--- pdf.lisp	(revision 66)
+++ pdf.lisp	(working copy)
@@ -62,7 +62,7 @@
    (subject :accessor subject :initarg :subject :initform nil)))
 
 (defmethod initialize-instance :after ((doc document) &rest init-options
-				       &key (creator "cl-pdf") empty author title subject keywords
+				       &key (creator (format nil "cl-pdf ~A" *version*)) empty author title subject keywords
 				       &allow-other-keys)
   (declare (ignore init-options))
   (unless empty
@@ -78,7 +78,7 @@
 					  ("/Pages" . ,(root-page doc)))))
       (setf (content (docinfo doc))
             (make-instance 'dictionary
-                           :dict-values `(("/Creator" . ,(format nil "~a (cl-pdf ~A)" creator *version*))
+                           :dict-values `(("/Creator" . ,(format nil "(~A)" creator))
                                           ,@(when author `(("/Author" . ,(format nil "(~A)" author))))
                                           ,@(when title `(("/Title" . ,(format nil "(~A)" title))))
                                           ,@(when subject `(("/Subject" . ,(format nil "(~A)" subject))))


More information about the cl-typesetting-devel mailing list