Recently we found Paul Madary's blog post about digital signatures in a Univeral Application (UWP) with iText 7, and we wanted to share it. Paul gracefully agreed to let us do that, and as a bonus we upgraded the code to be usable out-of-the-box with iText 7.1.3. The only change needed is the method SignDocumentSignature.

A big thank you to our Q3 top contributors!

There are so many people that contribute information to us in order to help improve our code, products and projects. We want to make sure that our top contributors are being recognized for the help they give and that they know how much we appreciate them.

We create a table with 2 columns and we add 6 cells. This will result in a table with 2 columns and 3 rows. As we removed the border and as we told the table that the first column should be 5 times as wide as the second column, the result looks like this:

Using a PdfPTable

Advantage: should there be too much text in one of the cells, then the content will automatically wrap and the size of the table will adapt to accommodate the content.

In this example, we create a paragraph for which we define tabs of 200 user units. Now when we add a Chunk.TABBING, the content will jump to that position. The result looks like this:

Using tabs

Disadvantage: when there is too much text in the first column, that text will run into the second column, and a tab will be added at the next 200 user units (could be on the same line, could be on the next line).

Solution #3: use spaces and a monospaced font

This is what you're doing, except that you don't use a monospaced font which doesn't give you the result you want.

Now we format the first String so that it always measures 35 characters. The result looks like this:

Using spaces

Disadvantages: if the text in the first column needs more than 35 characters, it will run through the second column and the text of the second column will be glued to it. You also see that I needed to use a different font. I use PTMono-Regular. Usually, text in a monospaced font takes more space than text in a proportional font.

Ready to use iText?

As always, if you have any technical questions, you can contact support with your valid support subscription or head over to one of our community support pages on Stack Overflow to see if your question has already been answered for our AGPL users.