13,402 questions
4
votes
0
answers
110
views
Find, Extract and Save Embedded XML File in PDF
I am currently trying to extract and save an embedded file from a PDF. It's about the German "ZUGFeRD" PDF (electronic invoice). In this PDF, there is a XML file named zugferd-invoice.xml or ...
Best practices
0
votes
0
replies
43
views
How to customize RegexBasedLocationExtractionStrategy to also return font information along with text location
I'm trying to develop a "template" processor which "replaces" tags (for instance $key1) with variable text. For this I plan to use RegexBasedLocationExtractionStrategy or a custom ...
Advice
1
vote
1
replies
128
views
Generating custom appearance for signature field using iText 9.0.5
I'm trying to create a custom signature appearance in iText9, the layout should be 2 thirds of (custom) text on the left side of the signature field and an image in the last third. This is how I ...
Best practices
0
votes
2
replies
66
views
Java.awt and itext.FontFactory font refactoring: What's the best way to refactor a large code base to a new font?
I am working with a large legacy application. Throughout the application, there are calls to generate PDFs with iText, or to generate text headers for charts etc. which utilize java.awt.Font to load ...
0
votes
1
answer
78
views
Crystal Reports PDF export produces large files and merged PDF size grows linearly
I am working on modernizing a legacy console application (.NET Framework 2.0 → 4.8).
The application generates invoice PDFs using Crystal Reports.
Previously to generate PDF we are using Acrobat PDF ...
0
votes
1
answer
79
views
Using iText 7 to create a pdf document from html with pictures that are larger than A4 paper. Images on their own pages that are same size as the img
I am using iText 7 to convert an html document to pdf. It works pretty well but images that are larger than the pdf page go outside of the page and that part cannot be seen when opening up the pdf ...
Advice
0
votes
1
replies
122
views
Replacing iText7 with iText - straight swap?
My WPF desktop app references iText7 v8.0.4 (+ iText7.bouncy-castle-adapter v8.0.4, which I assume is a dependency of it). Visual Studio shows that both packages are now deprecated and is telling me ...
1
vote
1
answer
82
views
PDF.js + iTextSharp: anonymization rectangles wrong on rotated (/Rotate) pages
I’m building a PDF anonymization feature:
Frontend: PDF.js viewer where user draws blackout rectangles on a page.
Backend: iTextSharp to draw black filled rectangles (anonymize).
If the pdf has Rotate ...
3
votes
2
answers
119
views
PdfAcroForm doesn't set values with SetValue
I've been trying to set some fields values in a PDF with iText but I'm unable to set the fields, the value set is the same of the field name and that is not what I'm expecting.
The code:
private async ...
0
votes
1
answer
172
views
Is it possible to create a valid PAdES-LT certification signature with DocMDP level 1 (“No changes allowed”)?
I’m trying to find out whether it is possible to create a PAdES-LT certification signature while setting the DocMDP permission level to 1 (No changes allowed).
I’ve tested adding the DSS in the same ...
0
votes
1
answer
98
views
Signing a PDF with a signature returned from an API [closed]
I've been searching and talking to ssl.com's AI assistant for days now and I'm trying to figure out how to sign a PDF using a hash instead of uploading the PDF bytes to their servers. It seems like ...
0
votes
0
answers
57
views
Exception found when using itextpdf TiffImage function
I got the following exception when using iTextPDF 5 to get the Image from Tiff.
Any idea how to resolve it?
`
Image img = Image.getInstance(myTiffFile);
Caused by: com.itextpdf.text....
3
votes
3
answers
216
views
Storing biometric data in a PDF without breaking the digital signature
I'm developing a tool that stores a signer's biometric data inside a PDF together with the digital signature, but I'm unsure where this information should be embedded.
The biometric data is captured ...
1
vote
0
answers
58
views
Issue width from xlsx (closed xml) to pdf (itextsharp)
I’m having an issue with the text font. I’m trying to convert an Excel file to PDF using ClosedXML and iTextSharp, and I want the text to fit perfectly inside each cell. However, sometimes the text ...
0
votes
1
answer
71
views
"Response Content-Length mismatch: too few bytes written (0 of 152295)" When copying pages from a PDF to another using iText
I'm trying to read a PDF as MemoryStream, and copy pages from that PDF to a new one.
I'm using iText PdfReader and PdfWriter.
var ms = new MemoryStream();
using PdfReader pdfReader = new ...
0
votes
1
answer
54
views
Creating Background Image in Itext7
So, I was trying to add a background image into my table, but the syntax requires Background Image object which then requires PdfXObject
val table = Table(floatArrayOf(50f, 50f))
....
3
votes
1
answer
120
views
"Cannot access a closed Stream" when trying to return PDF from controller using iText
I'm trying to copy pages from an existing PDF to a new one and return it. I'm writing to the new PDF with memory, but it returns an error stating
Cannot access a closed Stream.
Here is my code:
var ...
0
votes
1
answer
142
views
How to achieve per-phrase leading and alignment in OpenPDF ColumnText with inline rendering?
I'm working on a custom PDF text layout using OpenPDF ColumnText and need to render multiple phrases, each with its own leading, character spacing, alignment, and styling. Currently, I use ct....
0
votes
1
answer
62
views
iTextSharp rectangle drawn is shown incorrectly in a few pages
Drawing rectangles using iTextSharp 5.5.13.2, on a few pages, the rectangles are showing incorrectly. showing vertically instead of all horizontally.
I want to show a signature on multiple pages. To ...
1
vote
2
answers
188
views
How to correctly add Arabic text to an AcroForm field in iText 7/9 (.NET) so it stays correct after flattening?
I’m working with iText 9.3.0 for .NET and need to fill a PDF form field (PdfTextFormField) with Arabic text and then flatten it so the text becomes permanent.
However, when I set Arabic text directly, ...
0
votes
0
answers
53
views
How to enable kerning/ligatures (LayoutProcessor) with TTF loaded from Cloud Storage?
Library: OpenPDF 1.4.2 (com.lowagie.text.pdf)
Goal: Enable kerning and ligatures for TrueType/OTF fonts using LayoutProcessor (enableKernLiga) when rendering text via ColumnText/Paragraph.
Constraint: ...
4
votes
1
answer
105
views
iText PDF Persian text rendering issue — characters appear broken
I’m generating a PDF using iText (version 9.2.0) in C#.
The PDF contains Persian (Farsi) text, but the characters do not display correctly — they appear separated or broken.
here is my code :
public ...
0
votes
0
answers
89
views
iText SVG Converter keeps trimming whitespaces from tspan elements when the spaces are significant
I am using iText 9.2.0 and running into an issue where iText is trimming whitespaces in my SVG files I am receiving from a source I have no control over.
For example, the SVG will contain text like ...
0
votes
0
answers
82
views
ItextSharp C# : combine multiple PDFs with AcroFields specified
I have multiples PDF created with the iTextsharp library in C#. Those PDFs are created and are also using AcroFields.Item to create fields and field them with the users info.
Once I have created all ...
1
vote
1
answer
90
views
How do I get the destination page and rect of an internal link (GoTo action) in a PDF document?
I want to loop over all internal link (GoTo actions) on a PDF page and find the destination page number and rectangle.
Currently I am using this code:
public static void GetLinks(PdfDocument ...
0
votes
0
answers
125
views
iText XMLWorker: PDF generation fails with "Invalid nested tag tr found, expected closing tag td" when data contains special characters
I know this issue has come up before, but I haven't found any solutions that work.
I'm using iText's XMLWorker to generate PDFs from HTML templates in a Java backend.
Recently, I started getting this ...
1
vote
0
answers
65
views
iText cannot read part of the PDF
I have a PDF file which I am reading using iText 7.x, but some of the text doesn't get read.
Code:
Rectangle rect = new(0, 0, 1100, 1100);
TextRegionEventFilter regionFilter = new(rect);
...
0
votes
0
answers
67
views
Problem with iTextSharp - Text in wrong direction
I want to read a value from a specific area of a PDF file.
text to be read, reading area marked in red
For this, I have defined an area in the PDF that should be read.
MyCode:
Dim pageNumber As ...
0
votes
1
answer
124
views
Converting XML Signature to PKCS#7 and embedding into PDF results in "Signature is invalid" error in Adobe Reader
I'm working on digitally signing a PDF using an external signature service. The signing flow is as follows:
I add a SignatureField to the existing PDF to generate a valid /ByteRange, and produce a ...
0
votes
1
answer
104
views
Itext warning when validation using DSS The document contains undefined object modifications after the signature revision! after signing second time
I'm using this code to sign a PDF using itext version 8.0.4 in a .NET app.
public static void Sign(String src, String dest, Org.BouncyCastle.X509.X509Certificate[] chain, ICipherParameters pk,
...
1
vote
1
answer
127
views
Could not be verified in the Pades signature
I'm getting an error that the mathematical summary could not be verified in the C# Padessignature. I'm using IExternalSignatureContainer. I need your help for signing The code is signing successfully ...
0
votes
1
answer
176
views
How can i properly extract text from a PDF File, to store it in a Elastic-Search Index?
I'm working on a C#/Blazor project that extracts text from PDF files and stores it in an Elasticsearch index for full-text search.
The issue: when the PDF was originally a PowerPoint presentation, the ...
0
votes
1
answer
85
views
Print a big table on a PDF using ITextPdf7
I have an issue using ITextPdf-7.2.6.
I would like to print a big table on a PDF but I always have those two issues.
I have an infinite loop if I recreate the renderer or a NullPointerException if I ...
0
votes
0
answers
59
views
itext 5.5 add mp4 video
Is it possible to add mp4 videos to itet 5.5 and let them play upon showing?
What I tried:
final PdfPCell cell = new PdfPCell();
final Chunk chunk = new Chunk();
chunk.setAnnotation(PdfAnnotation
...
1
vote
2
answers
125
views
itext 5 emojis do not appear
I use Java and want to display emojis. This is the code:
final Document document = new Document();
FontFactory.register(getClass().getResource("/NotoColorEmoji.ttf").toExternalForm());
final ...
0
votes
0
answers
65
views
Issues Extracting Protocol Information from PDF Using iText 8 in C#
I'm not familiar with PDF parsing, but I am developing a program that processes PDFs with iText 8. My system utilizes an electronic protocol service to insert protocol information at the top of each ...
0
votes
1
answer
89
views
itextPDF tagging of input element for pdf
we use itextPDF v9.2 to generate PDF from HTML Code. The PDF is looking fine, but for the tagging of input elements for example
<input type="checkbox" id="$elementId" name="...
0
votes
1
answer
72
views
How to control line spacing when filling PDF form fields with iText, especially under line break scenarios?
How to control line spacing when filling PDF form fields with iText, especially under line break scenarios?
java code
package com.example.demo2.demos.test;
import com.lowagie.text.DocumentException;
...
0
votes
0
answers
47
views
itext-pdfsweep-dotnet CleanUpRedactAnnotations() does not apply font or font size of redaction annotations
itext-pdfsweep-dotnet does not appear to apply the font or font size of the redaction annotation overlay text, as set by SetDefaultAppearance(), for pdfs that are not forms.
I tried creating redaction ...
-1
votes
1
answer
87
views
PDFBox acroform unable to find fields previously added, on an iText signed pdf
i have a pdf that has a couple of signatures added using iText : iText signed file
I am using PDFBox(version 3.0.4) to add more signature fields into the same PDF using createEmptySignature() with ...
0
votes
1
answer
129
views
Flatten the annotations in the PDF
I would just like to burn all the annotations in the PDF as images. The reason is when any annotation is added to the PDF, it is easily movable using the Mac Preview application.
Hence if I were to ...
0
votes
1
answer
98
views
Hyperlink/bookmarks not working with remote repository
I have a service with a dependency to a document generation library. The library uses iText pdfHTML to convert HTML to PDF. Inside the document, the Table of contents contains links for jumping to ...
0
votes
1
answer
165
views
I can't achieve to conform my PDF Factur-X to PDF/A-3 using itext (ISO 19005-3:2012 clause 6.8 test 4)
I have for mission to create a PDF/A conform, and to do so I use fnfe-mpe.org validator
After a lot of work, I've achieved to reduce all my errors to only one, but I've looked through the net for ...
1
vote
1
answer
90
views
How to calculate the height occupied by a table in a PDF generated by JasperSoft Studio using iText 7 or any other libs (Java/Kotlin)?
I have a PDF file generated by JasperSoft Studio, which contains a table that is smaller than the size of an A4 page. The PDF is available to me as a byte array encodded as Base64 String in my code, ...
0
votes
0
answers
115
views
How to correctly sign a PDF in two steps using iText7 and external signature?
I need to implement a two-step PDF signing process using iText in C#.
The flow is as follows:
Prepare a PDF for signing — embed an empty signature field, calculate the hash, and return both the ...
1
vote
0
answers
54
views
Fillable pdf using iText does not show values when printing using AirPrint
I'm using iText to populate values in a fillable PDF. While the values appear correctly when the PDF is opened in most viewers, they do not show up when viewed using AirPrint. This issue affects both ...
1
vote
0
answers
65
views
NVDA is reading checkbox as unavailable in PDF
I have created a read only checkbox in PDF using itext (c#).
NVDA is announcing it as check box unavailable not checked read only.
I want to remove the unavailable word.
Sharing the code I have ...
2
votes
1
answer
128
views
Hash mismatch before QES signing with Swisscom and iText 7 – "Hash mismatch! Expected ... Got
I'm implementing a Qualified Electronic Signature (QES) flow using Swisscom Trust Services and iText 7.2.5 in Java. I'm stuck on the step where I compare the SHA-256 hash generated during PrepareHash ...
2
votes
1
answer
239
views
Change (via .NET app) existing PDF (generated from HTML with inline SVG) to include BBox attribute for SVG
I'm have an existing (generated) PDF that is Tagged (for accessibility, as shown in Acrobat Reader) - I have parsed it through the PDF Accessibility Checker (PAC - https://pac.pdf-accessibility.org/en)...
1
vote
0
answers
79
views
iText7 pdfXFA error AbstractITextEvent is only for internal usage
I am evaluating the iText7 pdfXFA add-on to flatten a Dynamic XFA PDF form. I've created a simple C# Console application and used the C# code example at https://itextpdf.com/products/flatten-pdf-...