On Thu, Jul 03, 2008 at 10:40:54AM +0200, Jonathan Sauer wrote:
Hello,
| If an end-of-line marker appears within a literal string without a | preceding backslash, the result is equivalent to \n (regardless of | whether the end-of-line marker was a carriage return, a line feed, | or both).
You are correct; when not escaped, a newline might be changed. Although if the string is a text string (opposed to containing binary data), this should not matter.
It does matter, <CR> and <LF> are different in bookmarks (only <LF> generates a line break in AR7/8).
Oh. Well, by not escaping a newline in the string, it is always treated by the readers als <LF>, no matter if it is an <LF> or a <CR>. So it always generates a line break in bookmarks. IMO the desired behaviour.
But <CR> or <CR><LF> are changed, and <BS><LF> are
removed (BS=backslash), ...
Therefore it isn't true that new lines don't need escaping in general.
It's a very dangerous business to neglect escaping needs.
Strings in the PDF format are used in many circumstances.
They can even have different semantics at different levels
(at low level parsing, strings are just a sequence of bytes or
see embedded file names, for example: They are sorted as
byte strings in a name tree and interpreted as file names.)
Yours sincerely
Heiko