[cl-pdf-devel] [Fwd: Re: cl-pdf question]
Wim Oudshoorn
woudshoo+cl-typesetting at xs4all.nl
Wed Oct 17 09:07:09 UTC 2007
> I am posting this question to the list at Marc's suggestion.
> If anyone knows how to configure cl-pdf to run under SBCL I'd sure
> appreciate some advice.
A while ago I wrote this to the cl-pdf mailing list.
It sounds you had a problem similar to mine.
Hope this helps,
Wim Oudshoorn.
---------- RESEND PART BELOW ----------------------------------
For me every example in cl-typesetting failed with SBCL 1.0.2 because
SBCL does by default not open streams in such a way that binary data can
be written.
The relevant section in the SBCL documentation is:
9.1 Bivalent Streams
A bivalent stream can be used to read and write both character and
(unsigned-byte 8) values. A bivalent stream is created by calling open
with the argument :element-type :default. On such a stream, both binary
and character data can be read and written with the usual input and output
functions.
I fixed it by the following patch, although, keep in mind that I just
started to play
with common lisp so I hesitate to suggest it to do it this way.
*** cl-pdf/pdf.lisp Tue Jan 3 17:01:21 2006
--- ../asdf-source/cl-pdf/pdf.lisp Thu May 31 16:56:44 2007
***************
*** 528,535 ****
(format s "~%>>~%startxref~%~d~%%%EOF~%" startxref))))
(defmethod write-document ((filename pathname) &optional (document
*document*))
! (with-open-file (s filename :direction :output :if-exists :supersede
! :external-format +external-format+)
(write-document s document)))
(defmethod write-document ((filename string) &optional (document
*document*))
--- 528,536 ----
(format s "~%>>~%startxref~%~d~%%%EOF~%" startxref))))
(defmethod write-document ((filename pathname) &optional (document
*document*))
! (with-open-file (s filename :direction :output :if-exists :supersede
! #+sbcl :element-type #+sbcl :default
! :external-format +external-format+)
(write-document s document)))
(defmethod write-document ((filename string) &optional (document
*document*))
More information about the cl-pdf-devel
mailing list