> -----Original Message-----
> From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]
>
> I'll reply to myself to save anyone from wasting time on this.  It turned
> out that the character encoding on the machines was different, and
> ByteArrayOutputStream.toString() was behaving funny on machines set to use
> UTF-8.  The problem was resolved by calling
> ByteArrayOutputStream.toString("ASCII") instead.
>

Just to make the explanation more complete:

> > The problem is that when run from our 'background' thread,
> > fop generates
> > almost empty pdf files, they contain only two lines:
> > %PDF
> > %
> >

Normally, according to the pdf spec, this should be followed by a few
'non-text' bytes to indicate that the rest of the file is to be interpreted
as binary - contrary to what its content would seem to indicate if you open
it in a text-editor...

<q>
If a PDF file contains binary data, as most do [...],
it is recommended that the header line be immediately followed by a
comment line containing at least four binary characters --that is,
characters whose
codes are 128 or greater. This will ensure proper behavior of file transfer
applications
that inspect data near the beginning of a file to determine whether to treat
the file�s
contents as text or as binary.
</q>

I cannot quite put my finger on it (knowledge doesn't extend that far yet),
but I guess the role of the encoding of these bytes is therefore not to be
underestimated in this case.


Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to