in reply to Re: Re: Editing text in PDF file
in thread Editing text in PDF file
I started writing pdf files by using print statements to generate the examples in the pdf documentation from Adobe. Then I started substituting my own commands for the ones in the example. There were some checksums that I needed to compute for the PDF, if I recall correctly.
It is straightforward to position text and draw vectors in PDF, although not quite as easy as it is in postscript. Text positioning is easiest to compute with a fixed-width font. Otherwise, you will need some other routine to determine how wide your text will come out.
For reading PDF, the process is just reversed. Many documents only use a few PDF commands. The documents that I was parsing were typically designed to be compatible with Acrobat 2.0, so they tended to be simpler. As the new readers became more widely used the documents tended to make more use of compression, which I don't believe I ever successfully decoded. The compression formats are not unusual or undocumented, but my work no longer required it. Instead, we switched to using a C-language API that we bought from Adobe, and we built our application on top an example that came with this API. Adobe discontinued the API product a few months after we bought it, and would not answer questions about their example. Not good after you spend $50,000 on software, and don't get the source code!
Since then, the open-source solutions have become proficient enough at PDF that they handle all my needs.
|
|---|