[cl-pdf-devel] [Sbcl-help] strange error in most recent CL-PDF with more recent SBCL?
A.J. Rossini
blindglobe at gmail.com
Sat Jul 11 07:15:10 UTC 2009
James -
That does the trick, THANKS!
On Sat, Jul 11, 2009 at 8:48 AM, James Fleming<lisp at electronic-quill.net> wrote:
>> PDF:WRITE-DOCUMENT function
>> seems to be unable to take a string or pathname, but throws the
>> following error (which I tried to resolve by OPENing the proper handle
>> and passing it):
>>
>> #<SB-SYS:FD-STREAM for "file /tmp/ex1.pdf" {BEC30D1}> is not a binary
>> output stream.
>
>
> Tony,
>
> I've recently run into this myself.
> After a bit of experimentation, I've had consistent success with passing
> it a filehandle opened for writing with :element-type :default, like so:
>
> (with-open-file (outstream #p"/path/to/outfile.pdf"
> :direction :output
> :if-exists :rename
> :element-type :default)
> (pdf:with-document
> <PDF stuff goes here...>
> (pdf:write-document outstream)))
>
> I first tried passing it a filehandle opened with :element-type
> '(unsigned-byte 8) but it them complained that it didn't have a stream of
> type character. I've no idea why you have to explicitly tell it to use the
> default element-type, but also don't have the time to dig around and
> figure that out.
>
>
> HTH,
> James
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Sbcl-help mailing list
> Sbcl-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>
--
best,
-tony
blindglobe at gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we
can easily roll-back your mistakes" (AJR, 4Jan05).
Drink Coffee: Do stupid things faster with more energy!
More information about the cl-pdf-devel
mailing list