Skip to main content
Skip table of contents

The Best iText 5 Questions on Stack Overflow

Introduction

A couple of years ago, I decided to self-publish new books about iText, as opposed to working with a publisher as I did before for the "iText in Action" books. This led to a book about digital signatures that is available for download on the iText site, and a book called "The ABC of PDF" published on LeanPub. The goal of "The ABC of PDF" was to start with a book that looks at PDF at the lowest level, examining the syntax of a PDF file and a PDF page, and then to continue writing a series of books that explain how to use iText on a higher level, answering questions such as:

  • How to create a PDF from scratch?

  • How to create PDF from HTML?

  • How to fill out PDF forms?

  • How to parse a PDF file?

  • ...

However, in spite of the fact that more than 15,000 people downloaded "The ABC of PDF", it turned out that people really wanted me to write a different kind of book. I've received many comments through LeanPub from people who were disappointed that the ABC-book didn't explain how to use iText. They expected a book with more practical examples, instead of examples that helps them understand the PDF specification. Some people even used the feedback form to ask me technical questions. Unfortunately, I was unable to answer these questions, because the people posting them didn't realize that I received these questions anonymously. Even if I knew the answers, I didn't know who or where to send them to.

All of this faced me with a dilemma: do I stop writing "The ABC of PDF" and start writing one of the other books that were planned? If so, which part of iText is most important to iText users? The plan for the ABC was to write a book of about 150 pages, but much to my surprise, I was only half way when I finished writing page 150. Didn't I have other writing priorities?

Then suddenly I had an idea: why not write a book with questions and answers? Why not create a book entitled "The Best iText Questions on Stack Overflow?"

Why Stack Overflow?

I joined Stack Overflow on August 24, 2012. Up until then, I had been answering many questions on the iText mailing-list. This mailing-list hosted on SourceForge used to be an important source of inspiration. I composed two "iText in Action" books for Manning Publications, simply by reorganizing the many answers and examples written in answer to question into a real book.

However, at some point I got tired of the mailing-list. When I referred to an example in one of my books, people would accuse me for trying to "trick them into buying my book." The mailing-list was also used by people spreading false allegations, such as "iText is no longer open source." One could explain that these people were wrong, for instance by providing a link to the source code, but there was no way to award people for providing good answers and to discourage people from posting bad answers. It felt as if the ungrateful were winning the debate.

Then I discovered Stack Overflow where people build a reputation getting reputation points when they ask good questions and provide good answers, losing points when they post bad questions or bad answers. I took me 2 years and almost 2 months to become a Trusted User, a status that requires 20,000 reputation points. Since I registered on Stack Overflow, I have posted answers to more than 1,000 questions. Looking back at some of the more elaborate answers, I thought it would be a good idea to bundle those questions and answers that are of "book quality".

Acknowledgments

I have selected nothing but questions I have answered myself, but it goes without saying that I can't answer every single question about iText personally. For instance: when I am travelling, I am off-line for many hours. As unanswered questions about iText give me stress, I am always happy to see that other people jump in when I'm away from my keyboard.

I want to thank Alexis Pigeon for editing many iText questions in order to clarify what is asked. I rely on Chris Haas for answering questions that require the C# skills that I am missing. I notice that I skip questions about digital signatures, because I know that Michael Klink's answer will be much more accurate than mine.

I also want to thank the many people who accepted one of my answers, because that's how one builds a reputation on StackOverflow. I know that some people down-vote me because my style can be harsh at times. Somebody once tweeted: "Spent a lot of time today on Stack Overflow and realized that Bruno Lowagie is kind of a dick." Ah well, I hope that the balance is positive.

Please understand that it is hard for me when people talk about "Lowagie" as if it's a thing, not a person. Sometimes people start by saying that they are using "Lowagie software" and then they start cursing at me if I give them an answer they don't like, for instance: please use a more recent version instead of a version that has been declared "End of Life" more than five years ago. So it goes... Not every developer realizes that I'm on their side and that their job is much easier if only their boss would purchase a commercial iText license so that they can use the most recent version.

How to use this book?

I've tried organizing the questions and answers in different categories. This wasn't always simple. If somebody asks a question about adding an image to a table, should this question be categorized under "images" or under "tables"? If there's a question about XHTML content that needs to be added to a column, is that an "XML" or a "ColumnText" question? A book isn't a web site where you can easily introduce a taxonomy. That's why I took great care when creating the table of contents.

In many cases, I rephrased the original question so that you understand what a question is about at a glance, just by browsing the bookmarks. In some cases, I even had to rewrite the question.

All the questions are marked with a question mark icon like this:

❓ This is a question

At times, I throw in a question of myself to clarify things. These questions are marked with an information icon:

(info) This is an extra question added by myself

Sometimes, it was important to add a comment that was made on Stack Overflow. I have marked comments like this:

🗣️ This is a comment

I hope you enjoy this book, and that it helps you solving all your iText problems. If not, please post a question on Stack Overflow and, who knows, maybe your question will be added to this book.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.