Questions tagged [itext7]

Library to create and manipulate PDF documents in Java and C#. Use this tag for code using iText version 7 and higher. Use the "itext" tag for older versions up to 5.5.x. Remember to also add a tag for the language you're using.

For more on iText, see here.

For more on the differences between iText 5 and iText 7, see here.

2125 questions
6
votes
1 answer

Cannot get trial license to load for itext 7

I am trying to explore the pdfsweep functionality of itext 7. I have obtained a 30 day trial license. When I call LicenseKey.loadLicenseFile(path-to-key-file), it returns without any errors, but when I attempt to instantiate a PdfCleanUpTool, I…
6
votes
1 answer

iText 7: How to build a paragraph mixing different fonts?

I've been using iText 7 for a few days to build pdf files, unfortunately, iText 7 is very different from iText 5 and the documentation is still very incomplete. I'm trying to build a paragraph that mixes two fonts or two fonts style (example: have a…
lpinho
  • 349
  • 2
  • 5
  • 10
6
votes
2 answers

xmlworker is missing in iText 7 core

I am trying to use iText 7 in Java. Want to covert HTML/XHTML to PDF. Apparently xmlworker.jar doesn't exist in iText 7 core. What is the replacement for iText 7? Any solutions?
Kino Fung
  • 61
  • 1
  • 3
5
votes
1 answer

Convert HTML Template to PDF using iText 7: how to move a table that prints across pages

I'm developing an asp.net mvc project and I'm using an html template to generate an invoice document with dynamic data which I filled up thanks to handlebars. The html resulting is being converted to PDF by using iText 7, since is the tool required…
Aldemar Cuartas Carvajal
  • 1,573
  • 3
  • 20
  • 39
5
votes
2 answers

How to change redaction text of a redact annotation created in Adobe Acrobat

Update: 2021-01-15 - Added Bounty I am trying to alter the redaction annotation to change the underlying text that gets burned into a PDF when you apply redactions. In Acrobat, you can set up a collection of "redaction codes" that can be used to…
Chronicide
  • 1,112
  • 1
  • 9
  • 32
5
votes
3 answers

Does Visual Studio update break iText7?

I have a problem with iText7 7.1.6 and Visual Studio 2019. My program has been running for a year now, but having just updated Visual Studio (Community) to version 16.6.2 from 16.6.1, I did a rebuild without changing anything. Now, when I run the…
Gerry
  • 129
  • 2
  • 13
5
votes
1 answer

What is the replacement for Chunk.NEWLINE in itext7

Chunk.NEWLINE adds an new line in iText 5. But iText 7 do not support Chunk. How do I add a new line using iText 7?
Sai Garimella
  • 53
  • 1
  • 1
  • 4
5
votes
1 answer

How to add an SVG to a PDF using iText7

I need to add an SVG graphic into PDF file. Is it that possible using iText7? Using iText5: BufferedReader in = new BufferedReader(new InputStreamReader(svgUrl.openStream())); String xmlParser =…
Ap Tsi
  • 99
  • 1
  • 9
5
votes
1 answer

Copy page from pdf file to new document

I am trying to copy one page from an existing .pdf file and paste it to a new document like this: using (var writer = new PdfWriter(OutputFile)) { var reader = new PdfReader("Templates//PDF_Template_Empty.pdf"); …
Сергей
  • 780
  • 4
  • 13
  • 31
5
votes
3 answers

iText7: Creating PDF from TIFF multipage image using iText

I am trying to use iText 7.1.1 to convert a TIFF image to PDF file with multiple pages. Thanks for those to get me started with this article Create PDF from TIFF image using iText. However, it is iText 5.5.x and I have trouble to duplicate it in…
user1747980
  • 245
  • 1
  • 4
  • 14
5
votes
0 answers

iText 7.1.0.0 - How to replace Rich Form Text in PDF Form Field

I have a PDF template with form fields where I used iText 7.1.0 to replace some placeholder text inside different form fields which is working fine: PdfReader reader = new PdfReader(pdf_template); PdfDocument pdf = new PdfDocument(reader, new…
André T.
  • 51
  • 3
5
votes
2 answers

Signing documents with iText 7 and GlobalSign DSS in .NET C#

We are trying to create a document signing solution with iText (v7) and GlobalSign DSS. Does anybody have experience with this? I can't find a lot (if any) examples on this. How is one supposed to combine the API requests ("identity",…
johey
  • 1,139
  • 1
  • 9
  • 25
5
votes
1 answer

iText 7 - Add and Remove Watermark on a PDF

I would like to add and remove a watermark to a PDF using iText 7. I was able to add the watermark, but unable to remove it again. I could only find relevant code/examples related to iText 5. Any pointers appreciated, thanks. This is how I added the…
Ivan
  • 368
  • 3
  • 14
5
votes
1 answer

How do I set line spacing for FormFields in iText?

It seems like the default line spacing in iText 7 form fields is 2 or 1.5, but I'd really like to remove the line spacing. Normally, I set line spacing by calling setMultipliedLeading(..) on a Paragraph object, but neither PdfAcroForm nor it's…
lucasvw
  • 1,345
  • 17
  • 36
5
votes
2 answers

Table Cell HorizontalAlignment is ignored/broken

I'm using iText 7.0.0 (the Java flavor) and it seems the table cell HorizontalAlignment is ignored because neither CENTER nor RIGHT works. Can you reproduce this? see the pdf screenshoot and the code to reproduce: private static void…
Rui Lopes
  • 93
  • 1
  • 6