[cl-pdf-devel] Problem with write-document with stream as opposedto pathname

Marc Battyani marc.battyani at fractalconcept.com
Thu Feb 26 20:59:32 UTC 2004


"Erik Enge" <erik at nittin.net> writes:


> I get two substantially different documents if I call write-document
> with a stream and a pathname.
> Ignoring creation date differences, in the one where I passed a stream
> to write-document, I observe
> /CLF101 instead of /CLF104 (don't know if this matters).
>
> But probably what makes my document generated via the stream unreadable
> in Adobe Acrobat
> Reader version 6.0 for Mac OS X is the following:
>
> 0 10                                                0 10
> 0000000000 65535 f                  0000000000 65535 f
> 0000000009 00000 n                 0000000NIL 00000 n
...

> The right is where I passed write-document a pathname, the left, a
> stream.
>
> Looking at the code in cl-pdf I don't see how this can happen so I'm
> wondering if
> I have aggravated something else, somewhere else.  I am absolutely sure
> that the
> only thing I am changing to reproduce this (it is fully reproducible)
> is whether I say
>
>    (pdf:write-document #p"/tmp/test.pdf")
>
> or
>
>    (pdf:write-document *my-stream*)
>
> Any clues?  I'm running cl-pdf 2.0 in LW 4.3.0 on Mac OS X 10.3.2.

Yes, you are probably using a stream for which file-position is not defined.

If you want to generate a PDF in memory, to send in a web server for
instance, you need to write it in a with-output-to-string and then write the
string to you real stream.

Marc





More information about the cl-pdf-devel mailing list