All Questions
5,706 questions
0
votes
0
answers
16
views
How to properly add multiple signatures to a document and sign it externally in a signing session using PDFBox?
I have a requirement to add multiple signatures to a document for a signer in one signing session. Following one of the suggestions from @mkl, I tried to apply his test code [...
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 ...
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 ...
1
vote
0
answers
36
views
PDFBox 3.0.2: Can't seem to properly tag image for accessibility
I'm trying to create a PDF document with better accessibility. It doesn't need to pass any standards but I would like to add alt text to images. I'm able to properly tag text, but I can't seem to tag ...
2
votes
1
answer
66
views
Converting PDF to TIFF for Faxing
I'm currently struggling to convert a PDF to a TIFF file that I can then fax via Asterisk.
It seems that the PDF tools library has this functionality, but it's not free. However, the documentation ...
1
vote
1
answer
139
views
PDFBOX3 sign - bouncycastle - cannot create signer: No installed provider supports this key: sun.security.ec.ECPrivateKeyImpl
MOTIVATION
I am trying to use latest PDFBOX 3 to sign pdf documents.
RIG
Windows machine with java23
CERTIFICATES
I have created domain certificates with certbot 2.9.0 and openssl-3.0.7 in jks, p12 ...
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 ...
2
votes
1
answer
119
views
Losing image resolution when converting PDF to image and back with PDFBox
I had a Java program written for me that would take a single page 36" high x 48" wide PDF file and would "slice" it into 3 single pages, 12x36, 24x36 and 12x36 of which I would ...
0
votes
1
answer
39
views
Fill PDF-form with individual data using java
Use case:
Customer's data is collected at the point of sale. Further in the business process, this data needs to be checked and verified and may be augmented with additional data. Therefore, a PDF ...
0
votes
1
answer
144
views
How to preserve permissions when digitally signing an encrypted PDF file using iText Java?
I'd like to digitally sign an encrypted PDF file. The original PDF is protected by password that you can't modify it or copy texts from it without providing the owner's password. However, I found I ...
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 ...
1
vote
1
answer
134
views
How to properly add multiple canvas into a PDF?
I wrote a Java program with iText 9.0.0 to create a PDF file. I need to add external PDFs as XObjects to every page of a PDF. Everything goes fine if the number of the PDF pages is 1 or 2. However, if ...
1
vote
1
answer
107
views
How to embed AI (Adobe Illustrator) / SVG / PDF files into a PDF directly in iText Java to avoid rendering glitch?
SVG files are not rendered properly in iText Java. I should find a better way to insert vectorgraphs into my pdf files.
I'd like to generate PDF files with some vectorgraphs and texts programmatically....
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 ...
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 ...
0
votes
0
answers
63
views
How to resolve the 'loca' table is mandatory issue when rendering PDF with PDFBox in Java?
I'm using PDFBox to render PDFs to images in Java, but I encounter an error related to the NotoColorEmoji font. Here's the exception stack trace:
java.io.IOException: 'loca' table is mandatory
at org....
1
vote
0
answers
43
views
How to add text to a PDF without significantly Increasing filesize?
I am trying to use Apache PDFBox to add text to existing PDF pages while keeping the file size increase minimal. My goal is to expand the page height, shift the current content upwards, and add the ...
0
votes
1
answer
94
views
Key to small for signature creation
I’m trying to sign a PDF document using a third-party API that signs the hash of the PDF. However, when I test the signed PDF with a signature validation tool, I encounter the following error.
The ...
0
votes
0
answers
38
views
PDFBox Free Text Annotation content is not visible on macos
I am trying to draw a free text annotation using rich content in pdfbox. The output file properly shows the annotation on Acrobat Reader. If I open it in the MacOS preview, the content of the free ...
0
votes
2
answers
141
views
Azure Key Vault signing fails when signing BouncyCastle generated signed attributes of PDF document
We're trying to use Azure Key Value private key to sign BouncyCastle generated signed attributes (embeds PDF hashable content digest) for a PDF document to allow for PDF signing.
However, the signing ...
1
vote
1
answer
53
views
How to generate a multi-page PDF with mixed orientations (vertical and horizontal) from an HTML document? [closed]
I have an HTML document where each section represents a single A4 page. I’d like some sections to be in portrait (vertical) orientation and others in landscape (horizontal).
However, when I generate a ...
0
votes
0
answers
107
views
Error: End-of-File Exception while merging two PDFs by Apache PdfBox
I'm trying to merge two .pdf files - one comes to me as a byte array, second one I'm keeping in resources file - then I need to return combined PDFs as a byte array. I'm trying to do it by using temp ...
1
vote
1
answer
126
views
PDFBox 3.2: Missing Bounding Box Error in PAC for Image Tag in PDF/UA
I'm trying to create a PDF/UA document using PDFBox 3.2, and I’ve followed the solution suggested by @Tilman Hausherr in this Stack Overflow post. I managed to tag both text elements and images, and ...
0
votes
0
answers
72
views
is there a way to remove only QR codes from each page of a PDF using iText7
I am trying to remove QR code from each page using iText7 but it is distorting every other text values and components of the page, is there a way to do it in a proper way. Below is the code I am using:...
1
vote
1
answer
213
views
Issue Creating PDF with PDF/UA Compliance - PAC Checker Shows "Test Object Not Tagged"
I'm currently working on generating a PDF file that is PDF/UA-compliant. My main goal is to ensure that it meets accessibility standards and passes the PAC (PDF Accessibility Checker) tool.
The ...
4
votes
2
answers
167
views
Split A4 page into A7 sections [closed]
I'm given a document of A4 pages with 8 A7 sections on each page.
I need to extract the data from each A7 area of each page because they're related.
Is it possible to break each A4 in 8 A7 and go ...
1
vote
1
answer
241
views
How to add the annotation tag in tagged PDF using PDFBox
I have a tagged PDF (PDF-UA compliance) with simple structure:
I need to add the annotation:
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns....
1
vote
2
answers
99
views
Borders generated in PDF Template using Java Apache PdfBox
In the nearest future I will be developing a PDF generating service. It's all about a simple template being filled using data coming from request.
During my research I heard about Apache PDFBox and at ...
0
votes
1
answer
59
views
Open a recent PDF created in Android
I'm using Android Studio to make a simple app to create some PDF files to store some data. I wanto just to make an intent for the generated PDF auto opens for the user.
Here's just the canvas drawing ...
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 ...
0
votes
0
answers
32
views
unable to download pdf from mariadb using flutter web
I am having a hard time downloading a pdf from mariadb.
I can download the json file without any issues.
This is what I see in the Mariadb database. I am storing the attachment data in a longblob.
...
1
vote
0
answers
95
views
Error converting file to pdf No office manager available after 30000 millisec
When I am sending multiple requests to convert to PDF I am getting No office manager available after 30000 millisec exception.
Any help will be appreciated.
I tried 2 solutions below, but it was not ...
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>
&...
0
votes
0
answers
119
views
How can I reduce the size of a PDF file in Java using PDFBox or other libraries?
I'm working on a Java project where I need to reduce the file size of a PDF. I’m using PDFBox /itextPdf to handle PDF files, but I’m not sure how to optimize or compress the PDF to reduce its size.
...
1
vote
1
answer
119
views
How to remove emojis on filenames or usernames?
I have an issue with my emoji remover method.
This method is used when downloading chat transcripts and checks for any emojis in the username, removing them if present. It works in the local and ...
0
votes
0
answers
36
views
In Java, is it possible to concatenate the contents of two PDF files in order to concatenate the visible contents of the files? [duplicate]
I have a back-end Java application that grabs the contents of PDF files from a blob in the database, and puts them into a byte[] array to be able to download.
My end goal - if possible - is to append ...
-2
votes
1
answer
95
views
Generate PDFs using Spring
I'm trying to generate PDFs from scratch using Spring. After some research, I've found a number of libraries such as iText, PDFBox, Apose, Jasper, etc. Looking at org.springframework.web.servlet.view....
-1
votes
1
answer
70
views
Why is PdfConverter very slow during the first conversion? How can I slove this problem
I'm using PdfConverter to convert word to pdf.But I find that pdfConverter very slow during the first conversion.Then It gets faster.
The response time of my spring boot application use PdfConverter ...
0
votes
0
answers
94
views
pdf viewr not work Cannot resolve symbol 'barteksc'
i taken a project and uploaded the files but pdfviewer not work and i have uploaded the gradle files but still no work
package com.dimension.a3dimension;
import android.content.res.Configuration;
...
-1
votes
2
answers
114
views
Can't draw SVG in PDF with Apache FOP - Unknown formatting object "{}svg" encountered (a child of fo:instream-foreign-object}
I created the following code for a simple checkbox in a table using XSL-FO:
Java code
Element svg = document.createElement("svg");
svg.setAttribute("width", "12pt");
svg....
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 ...
0
votes
0
answers
76
views
How can I validate external references in a PDF using Apache PDFBox?
I'm working on a project where I need to validate external references in PDF files using Apache PDFBox. Specifically, I want to check if a PDF contains any external references, such as links to ...
-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 ...
0
votes
0
answers
29
views
PDAnnotationLink with image
Code snippet to add PDAnnotationLink
final PDAnnotationLink txtLink = new PDAnnotationLink();
PDBorderStyleDictionary pdBorderStyle = new PDBorderStyleDictionary();
pdBorderStyle.setStyle(...
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 ...
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 ...
0
votes
0
answers
54
views
Apache FOP and image caching problem in java project
In java code, xml is transformed into pdf
we use saxon to prepare XSL-FO (from XML + XSLT)
Then we use fop 2.3 (there is no way to update yet) to transform XSL-FO into pdf
Problem:
Sometimes the ...
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 ...
-1
votes
1
answer
79
views
why java not keeping the size of blank space as a character in pdf file [closed]
I was trying to create a pdf file java using
new_canvas.drawText("To",20,90,pdf_paint);
in between I wanted to align a few lines one below the other like a table.
for that I added few blank ...
0
votes
0
answers
72
views
Alignment issue in table from HTML to PDF
Using Flying Saucer 9.1.18 (flying-saucer-pdf) to generate PDF from HTML/xml to PDF file in my java program.
I noticed that if I open the input xml in the browser, the text (Lorem ipsum etc) is all ...