Hello, I have a question about the PDF header. I have noticed that we have some pdf's that have a header like "%PDF-1.3\r\n", note that this header has both a carraige return and line feed (\r\n). Then I have some other PDF's with a header like "%PDF-1.5\r", this has only a carraige return and NO line feed. Is the header without the line feed still valid? I have done some page extracts from Adobe Acrobat Pro (v 8.1.0) and noticed that when saving the page extracts from the Adobe software it also creates a header without a line feed character, so I'm guessing this is valid but would like confirmation. Thank you for your time.
This is all described in section 7.5 of the PDF spec (File Structure). In
7.5.1 (General), you'll find the following about the line endings: "Each
line shall be terminated by an end-of-line (EOL) marker, which may be a
CARRIAGE RETURN (0Dh), a LINE FEED (0Ah), or both. "
So, you can use one of the three different methods of ending a line: \r, \n
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...