Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
45 views

Reduce Pdf File size using java

I am trying to create a pdf file using PDDocument but output pdf size is more than 15 mb. i want to reduce so that max pdf size is max 10 mb Creating pdf file : (templateList is list of all ...
Preeti Joshi's user avatar
1 vote
1 answer
41 views

ClassCastException when casting IBasicOCSPResponse to IBasicOCSPResp in iText 8.0.4

I am working with iText 8.0.4 (GitHub Repository) and trying to cast IBasicOCSPResponse (from com.itextpdf.signatures) to IBasicOCSPResp (from com.itextpdf.commons.bouncycastle.cert.ocsp). This is ...
blinkbink's user avatar
  • 119
1 vote
0 answers
32 views

iText keeps throwing "Object null reference exception" for ShowTextAligned [duplicate]

While doing PDF operations - can anyone help here? I'm getting the following error while doing header: System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance ...
Durgesh Awasthi's user avatar
-2 votes
0 answers
34 views

How to edit PDF in C# in Windows Forms [duplicate]

This is my code: public class PDFGenerator { public static void FillCharacterSheet() { string inputPdfPath = @"D:\mypath\DnD_5E_CharacterSheet_FormFillable.pdf"; ...
KitKobry's user avatar
0 votes
1 answer
82 views

Data replacement in a PDF Template (Java | SpringBoot)

I am working on a project in spring-boot that signs visually pdfs. The idea is that I am researching different ways to manipulate the pdfs using java and cannot find the most optimal one. For example ...
c8a's user avatar
  • 1
1 vote
1 answer
51 views

How to read rotated text?

I have tried this string text = ""; using (PdfReader pdfReader = new PdfReader(dlg.FileName)) { for (int page = 1; page <= pdfReader.NumberOfPages; page++) { text = ...
SYED RASHID's user avatar
1 vote
1 answer
53 views

Error while signing multiple signature fields using itext c#

When the PDF is opened for the first time, the user can add a signature without any issue. However, during the same session, if the user tries to add a second signature, this error occurs. After ...
Dharmendra Sinsinwar's user avatar
1 vote
1 answer
52 views

How to align vertically Text and Image elements in a Paragraph?

I'm wondering how can I align vertically elements in a Paragraph with IText 9 val icon = Image(ImageDataFactory.create(XXX::class.java.getResource("/pdf/xxx.png"))) .scaleToFit(30f, 30f)....
poussma's user avatar
  • 7,311
1 vote
1 answer
46 views

The verification of the PDF did not pass

I am using iText to digitally sign PDF files, and we are using a non-internationally popular algorithm called SM3WITHSM2. However, the signed file cannot be verified now, and I am not sure where the ...
chiao kang's user avatar
1 vote
0 answers
118 views

Trying to Maintain PDF Formatting When Replacing Text?

Summary: I've been working extensively on automating text replacement in PDF documents using Java. My goal is to preserve the original formatting and structure of the PDFs. Despite trying multiple ...
Ezee's user avatar
  • 33
1 vote
0 answers
56 views

PDF generated from Itext 5.5.13.3 text problem

I'm facing some problems with legacy code (.NET Framework 3.5). The combination works, and I've successfully combined the two PDFs. However, when I open the combined PDF, the text is only visible ...
LuigiDev's user avatar
0 votes
0 answers
30 views

java.lang.ClassCastException when using iText 2.2 to stamp data into a PDF

I am encountering a java.lang.ClassCastException in my application when using iText 2.2 to sign and stamp certain PDF documents. The error occurs intermittently when processing PDFs that include ...
AccOUCH's user avatar
0 votes
1 answer
93 views

Sign PDF using iTEXT java with certificate in cloud with no container CMS (naked data)

I am implementing a PDF digital signature process using iText 7 in Java. The workflow requires me to: Prepare the PDF for signature: Create a visible signature field and generate the hash of the PDF ...
Wesley Alves's user avatar
0 votes
0 answers
49 views

Converting PDF to PDF/A-2b with Itext

I have set of methods like following and I need to generate PDF/A-2b file and I need to replace the fonts in pdf if they are not embedded. I need fix following validation errors. The font programs ...
R0b1n's user avatar
  • 603
0 votes
0 answers
118 views

How to Completely Remove All Metadata from a PDF using iText in .NET

I manage sensitive PDF documents and need to ensure all metadata is stripped before they are shared with third parties. Currently, my process involves physically printing and scanning the documents to ...
tmighty's user avatar
  • 11.4k
1 vote
0 answers
84 views

Is there a scale function (ie 1:100 rather than changing the page size) for PDF within iText?

enter code hereI've been trying to print a set of CAD drawings to file using iText and then set some specific things like page labels and outlines (bookmarks) etc. I've been unable to find any ...
Edward Strain's user avatar
0 votes
0 answers
48 views

Correctly fit image size into existing PDF

I'm writing a simple application to convert images into single pages pdf files. The application works fine (the full source code is available on github), but this method gives me some problem: ...
weirdgyn's user avatar
  • 988
2 votes
2 answers
174 views

How to remove the read-only mode and signatures of a digitally signed PDF with pdfbox

From time to time we want to remove the write-protection/"encryption" and digital signatures of our PDF documents, so the document can be changed and re-signed. E.g. because the original ...
swaechter's user avatar
  • 1,439
0 votes
0 answers
103 views

How can I ensure that emojis are displayed correctly in PDF filenames and its content?

I am using iText to handle different fonts and emojis, but the emojis are not displaying as expected. They are being removed completely instead. These are my dependencies <properties> &...
Esphi01's user avatar
  • 21
0 votes
2 answers
52 views

Converting a Multi Page TIFF Document to a PDF Using lowagie itext

Does anyone know how to convert all of the pages in a multi page TIFF document to a PDF using lowagie itext 2.1.7?
Timothy Noon's user avatar
0 votes
1 answer
97 views

How to correctly configure space between lines for PDF generated with text-pdf 8

I'm working in an app to generate some PDFs and I'm doing some POC with itext-pdf library. I'm facing some issues finding the correct line spacing. I generated manually an example of what I want to ...
Alvaro Pedraza's user avatar
0 votes
0 answers
263 views

How to Validate JavaScript and Detect XSS in PDF Files?

I am working on adding JavaScript to a PDF file using the and then validating the presence of JavaScript in the PDF. However, I am having trouble detecting the JavaScript I added. The issue is that ...
Ravi Dobariya's user avatar
0 votes
0 answers
47 views

how can i use libharu convert chinese text to pdf

bool textConvertToPDF(std::vector\<std::string\> text, std::string filePath) { HPDF_Doc pdf = HPDF_New(nullptr, nullptr); if (!pdf) { //throw std::runtime_error("Failed to create PDF ...
renzhihe's user avatar
-2 votes
1 answer
103 views

Apache PDFBox not able to extract text, but PDFBox Debugger showing the text correctly? [closed]

I am not able to extract text from a pdf, it is showing garbage characters, but when I checked with the debugger, it was showing the correct text. Here is the pdf link. Let's say I am trying to ...
Akshdeep Singh's user avatar
0 votes
0 answers
43 views

How can I export a DataGridView to a PDF with a watermark using iTextSharp in VB.NET?

I'm working on a VB.NET Windows Forms application and need to export the data from a DataGridView to a PDF file. Additionally, I need to include a watermark image in the background of each page of the ...
Gorilla Byte's user avatar
0 votes
1 answer
125 views

I am not capable to generate a PDF/A

I am trying to generate a PDF/A-1b in Java, I tryed a lot different things but none of then have work for me, every PDF I generate is no capable of pass the PDF/A validation. (I am using VeraPDF to ...
S3RG1OGALAZ's user avatar
1 vote
0 answers
63 views

How to create a dynamically generated Table of Contents (TOC) with page numbers for a merged PDF using iText 5 in Java?

I'm working on a Java project where I use iText 5 to merge multiple PDF files generated by Crystal Reports into a single PDF document. After merging these PDFs, I need to add a dynamically generated ...
Usama's user avatar
  • 77
0 votes
0 answers
34 views

PDFTable using ItexSharp - Blank space on table with many items in PDF

I need your help, since I have tried several things but I have not been able to solve a problem that I have. I have a RECEIPT that has many documents, and when this happens the table that generates ...
Ronald Petrussa's user avatar
0 votes
0 answers
170 views

Converting XFA Form to Static PDF in C# for Browser Compatibility

I have this C# code and I am trying to convert an XFA form into a standard static PDF so that it can be opened in a browser. Unfortunately, the code converts the XFA form in such a way that the ...
František Rýsl's user avatar
0 votes
1 answer
49 views

How to Continuously Merge PDFs Without Adding Extra Pages Using iText 5

I'm working on merging multiple PDFs using iText 5 in Java. My goal is to merge the PDFs in such a way that the second PDF starts immediately after the content of the first PDF ends, if there is space ...
Usama's user avatar
  • 77
0 votes
0 answers
22 views

How to align in itextsharp signature box

I have a signature area that surrounds the words "Nhận xét" and "Người xác nhận". enter image description here I keep the size of the signature area the same and align the corner ...
Call me Su's user avatar
1 vote
0 answers
58 views

How to sign PDFs using "GOST-3411-2015-512" and "ECGOST3411-2015-512"?

I using old iText 2.1.7 in a legacy project. I'm working with KalkanProvider and BouncyCastle for cryptographic operations. I need to signing PDFs using the "GOST-3411-2015-512" and "...
superkuzet's user avatar
0 votes
1 answer
61 views

Add sign to PDF using old iText-2.1.7

I'm working on a legacy project that uses the old iText-2.1.7 library. I'm just starting to figure it out and I won't be upgrading to a more modern version yet, so I need help with this version ...
superkuzet's user avatar
0 votes
1 answer
137 views

Verify PDF signature using iText 8

Been using iText to sign PDF files using self signed certificate. Is there a way to take a PDF as input and verify whether it is signed using my self signed certificate ? (hence verify it was ...
Hagay Goshen's user avatar
0 votes
0 answers
76 views

How to Generate PDFs with Mixed Hebrew and English Text in .NET 6+?

I need to generate PDFs that support both Hebrew and English text. I've tried using iTextSharp(it is not MIT or Apache license), but I'm encountering issues with rendering mixed language content (...
Sandeep's user avatar
  • 31
0 votes
0 answers
28 views

How can I get the X and Y positions of a word in a specif page and specific line of a pdf with itextsharp?

I have a pdf documentation where hundreds of CNC patameters are explained. I have a C# code where I find the related parameter definition word and the correct page number call a method with this two ...
Mdarende's user avatar
  • 739
0 votes
1 answer
51 views

How can we set fieldproperty of setfflags to read-only a formfield using java itext 8.0.4 version

form.setfieldproperty(field, "setfflags", PdfFormField.FF_READ_ONLY, null); How can we set fieldproperty of setfflags to read-only a formfield using Java iText 8.0.4 version, when migrating ...
Lucky's user avatar
  • 11
0 votes
0 answers
24 views

iTextSharp Header is merging with document content

I need is header table on all pages and page content/table which will be different every page. I am using PdfPageEventHelper for header. I have below code in OnOpenDocument header.WriteSelectedRows(0,...
Dnyati's user avatar
  • 179
0 votes
1 answer
72 views

Itext 7.0 - Acroforms are empty

I have a PDF form with filled out fields. If I try to read the acrofields they are empty. But in the PDF I can change the values and save them. namespace Tutorial { public class FillForm { ...
Jesse Hamlin-Navias's user avatar
0 votes
0 answers
20 views

Set the line spacing between 2 lines iTextSharp

I am using iTextSharp to generate pdf. I have a table and need to add text in the table cell. I used Chunks & paragraph to add text in table. For new line I use \n in chunks. But the line spacing ...
Dnyati's user avatar
  • 179
1 vote
1 answer
263 views

Generating multi-page pdf with Itext Html2Pdf

I am using iText in C# to convert HTML to a PDF. When converting the HTML to a PDF it works fine if the HTML content is within 1 page but if the content is greater than 1 page, the code doesn't work. ...
fahad shaikh's user avatar
-1 votes
1 answer
397 views

itextPDF 8 to generate pdf with emoji font support

I'm trying to find out a way to create pdf with emoji fonts support by using itextpdf 8.0.3. I only found an example that came from itextpdf official website; https://kb.itextpdf.com/itext/pdfhtml-...
cidy.long's user avatar
  • 427
0 votes
2 answers
125 views

What ways are there, if any, to read/edit a PDF's human-readable format (operators/operands)

It is my understanding that PDFs, or at least some parts of PDFs have a readable text representation, i.e. language. (Not very readable! But readable.) In the process of learning about how PDFs can be ...
barneypitt's user avatar
  • 1,180
0 votes
1 answer
84 views

Footer in the PDF created using iTextPDF is not accessible

I have created a simple PDF here to explain the issue I am facing import com.itextpdf.io.font.FontConstants; import com.itextpdf.io.image.ImageDataFactory; import com.itextpdf.kernel.events....
karthik b's user avatar
0 votes
0 answers
79 views

How to use custom ToUnicode maps for text extraction

Tying to use iText7 to extract text from pdf file outputs question marks only: ???????? ?????????? ? ???????????????????????? ??????????????????? ???????? ???????????????????????????? ?????????????????...
Andrus's user avatar
  • 28k
0 votes
1 answer
313 views

Extracting text from pdfs with embedded fonts

I need to extract text from pdf files - seems simple enough. Here is my problem. When i open the pdf in a pdfviewer like Adobe Acrobat I see the text as normal text i can read it. When i use iText7 ...
HellOfACode's user avatar
  • 1,743
0 votes
0 answers
114 views

How to extract text instead of question marks from PDF file

Tying to use iText7 8.0.4 to extract text from pdf file outputs question marks only: ???????? ?????????? ? ???????????????????????? ??????????????????? ???????? ???????????????????????????? ???????????...
Andrus's user avatar
  • 28k
1 vote
1 answer
60 views

got strange result by using iText's PdfAcroForm.GetAllFormFields to grab data

I have a strangeform.pdf file, using following code to grab data from that file using iText.Forms.Fields; using iText.Forms; using iText.Kernel.Pdf; using System.Text; PdfDocument pdfDoc = new ...
hjyanghj's user avatar
  • 338
0 votes
0 answers
43 views

How to make itext support Cambodian, Thai, Arabic

I have a JAVA WEB system that requires PDF to create artwork, but the user told me that the text tested in Thai, Cambodian, and Arabic is incorrect. Our system kernel, itext4, may have added content ...
antonisChen's user avatar
1 vote
1 answer
239 views

Add new page to PDF document using iTextSharp - C#

I want to generate a PDF file with multiple scanned pages using scanner. I used iTextSharp to achieve this: bool continueScanning = true; ScanDirectory = Environment.ExpandEnvironmentVariables("%...
user3309231's user avatar

1
2 3 4 5
112