When I wrote the first book about iText, the publisher didn’t like the
subtitle “Creating and Manipulating PDF.” He didn’t like the word
manipulating because of some of its pejorative meanings. If you consult the dictionary on Yahoo! education, you’ll find the
following definitions: To influence or manage shrewdly or deviously To tamper with or falsify for personal gain
Obviously, that’s not what the book is about. The publisher suggested
“Creating and Editing PDF” as a better subtitle. I explained that
PDF isn’t a document format well suited for editing. PDF is an end
product. It’s a display format. It’s not a word processing
format.
In a word processing format, the content is distributed over different
pages when you open the document in an application, not earlier. This
has some disadvantages: if you open the same document in different
applications, you can end up with a different page count. The same
text snippet can be on page X when looked at in Microsoft Word, and
on page Y when viewed in Open Office. That’s exactly the kind of
problem you want to avoid by choosing PDF.
In a PDF document, every character or glyph on a PDF page has its
fixed position, regardless of the application that’s used to view the
document. This is an advantage, but it also comes with a disadvantage.
Suppose you want to replace the word “edit” with the word “manipulate”
in a sentence, you’d have to reflow the text. You’d have to reposition
all the characters that follow that word. Maybe you’d even have to
move a portion of the text to the next page. That’s not trivial, if
not impossible.
If you want to “edit” a PDF, it’s advised that you change the original
source of the document and remake the PDF. If the original document
was written using Microsoft Word, change the Word document, and make
the PDF from the new version of the Word document. Don’t expect any
tool to be able to edit a PDF file the same way you’d edit a Word
document.
This being said, the verb “to manipulate” also means To move, arrange, operate, or control by the hands or by mechanical means, especially in a skillful manner
That’s exactly what you’re going to do in this chapter. Using iText,
you’re going to manipulate the pages of a PDF file in a skillful
manner. You’re going to treat a PDF document as if it were made of
digital paper.