[cl-pdf-devel] Using cl-pdf rev 134 with SBCL 1.0.2
Brian Sorg
brian.sorg at liberatinginsight.com
Sat Feb 10 16:24:32 UTC 2007
Please forgive me if this a redundant I have only been scanning the
emails sent to the list recently, but I was experimenting with the
latest SBCL version (1.0.2) and ran into the same error with writing to
the streams that I believe was being discussed a week or two ago.
The problem as was noted is that SBCL needs to specify the the
element-type as :default when opening a bivalent stream. One solution to
this is either to not include the :pdf-binary keyword in the features
list. To turn this off comment out the line
(push :pdf-binary *features*) in the config.lisp file.
The code solution to this is to modify the write-document method in the
pdf.lisp file as follows:
----------------------------------------------------------------------
(defmethod write-document ((filename pathname) &optional (document
*document*))
(with-open-file (stream filename
:direction :output :if-exists :supersede
:element-type #+pdf-binary #+sbcl :default
#-sbcl'(unsigned-byte 8)
#-pdf-binary 'base-char
:external-format +external-format+)
(write-document stream document)
filename)) ; indicate that operation succeeded
-----------------------------------------------------------------------
In this case though it will be important to remember that if you feed
write-document a stream that it will have to define the :element-type as
above.
With the above change I was able to successfully run the cl-pdf examples
provided on Linux. I didn't test it on the windows release.
I don't believe that I have access to check this in so if someone could
take care of that or Marc if you would like to grant me permission I can
do it?
Have a great weekend.
Brian Sorg
Liberating Insight LLC
brian.sorg at liberatinginsight.com
More information about the cl-pdf-devel
mailing list