Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Re: stream object with reference to its length

$
0
0

Here is one example: For a true text file, it does not make a big

difference if your line endings are LF or CR or a combination of both

(which ones are used depends on your operating system and text editor

software used). A good text editor can juggle all these and give you what a

human would consider the correct view of the document. In a PDF file, it

does matter quite a bit if you use LF or CR/LF - the first one only adds

one byte to the file, the second one adds two bytes. Because everything in

the PDF file is referenced via the byte offset from the Xref table, having

a line ending be one vs. two bytes makes a big difference. In one case,

your offsets are correct, in the second one they are not, and therefore the

PDF file is corrupt.

 

Contrary to what lrosenth says, I believe you can create a PDF file in

NotePad++ (or any other text editor), and I do so regularly in my

trainings, but you have to be absolutely certain you understand how byte

offsets work and how to get them correct. Even though you can do this,

normally you would not (unless it's a training exercise). It's much easier

to write out the PDF file in software and keep track of all byte offsets as

the objects are generated so that you can then create a valid Xref table.

If you want to know more about the potential problems with the Xref table,

see this blog post I wrote a few years ago:

http://khkonsulting.com/2013/01/the-trouble-with-the-xref-table/


Viewing all articles
Browse latest Browse all 10848


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>