PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________
> Basically I encrypt a string and then I'm outputting the
> binary encrypted
> string. But the binary happens to contain a "(" or a ")"
> character. ANd I
> believe that this may be causing my issue. For example, I
> output a title
> element
>
> /Title ( .. bunch of encrypted bytes but includes a ) or a (.. )
>
> With the () it assumes the string is closed before it
> actually should be.
> Should I be outputting the hex equivalents (using < and >)
> instead? Or is
> there another method for this?
The encryption works after the scanner. It has to, because
decryption is token by token.
This implies that what you write to a PDF must be a valid string.
It so happens that the bytes in that string are encrypted, but the
scanner/tokeniser doesn't care about that.
So, you need to follow exactly the same rules you would follow
to write any string. Unmatched parentheses, and backspaces, must
be escaped. Or you can write any string as a hex string. It's up
to you which you do. You can use your normal string-writing
logic (assuming that the string writer copes with automatically
escaping special characters).
Similarly, don't pre-escape a string to encrypt it. If the string
was written in the PDF as (A \(paren\\thetical\) comment) the string
you must encrypot is A (paren\thetical) comment.
Aandi
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html