[cl-typesetting-devel] PDF document information dictionary - creator vs. producer

Dmitri Ivanov divanov at aha.ru
Mon Jun 14 18:38:30 UTC 2004


Hello,

IMHO,  "cl-pdf version x.x.x" should be specified with the "/Producer" key,
not with "/Creator". According my understanding of the PDF Reference,
"/Creator" is where the name of a top-level application using cl-pdf should
be placed. Below is the patch.

(defmethod initialize-instance :after ((doc document) &rest init-options
           &key empty creator author title subject keywords
                                       &allow-other-keys)
  (declare (ignore init-options))
  (unless empty
    (let ((*document* doc))
      (setf (objects doc) (make-array 10 :fill-pointer 0 :adjustable t))
      (setf (catalog doc) (make-instance 'indirect-object))
      (setf (docinfo doc) (make-instance 'indirect-object))
      (setf (root-page doc) (make-instance 'page-node))
      (setf (outline-root doc)(make-instance 'outline))
      (setf (content (catalog doc))
     (make-instance 'dictionary :dict-values
              `(("/Type" . "/Catalog")
                ("/Pages" . ,(root-page doc)))))
      (setf (content (docinfo doc))
            (make-instance 'dictionary :dict-values
              `(("/Producer" . ,(format nil "(cl-pdf version ~A)"
*version*))
                ,@(when creator `(("/Creator" . ,(pdf-string creator))))
                ,@(when author `(("/Author" . ,(pdf-string author))))
                ,@(when title `(("/Title" . ,(pdf-string title))))
                ,@(when subject `(("/Subject" . ,(pdf-string subject))))
                ,@(when keywords `(("/Keywords" . ,(pdf-string keywords))))
                ("/CreationDate" . ,(multiple-value-bind (second minute hour
date month year)
                                        (get-decoded-time)
                                      (format nil
"(D:~D~2,'0D~2,'0D~2,'0D~2,'0D~2,'0D)"
                                              year month date hour minute
second)))))))))

--
Sincerely,
Dmitri Ivanov
lisp.ystok.ru





More information about the cl-typesetting-devel mailing list