Skip to content
Advertisement

Tag: itext

iText: how to add a String to a cell

Hi guys I am an absolute beginner so go easy on me, why is this not working for me, I really do not understand why this is not working, but I am a beginner so if someone could correct this for me, I would really appreciate it. I am surprised that it does not work My Error messege: Answer iText

number of page of document in Java

I have the base64 and the byte[] of a pdf document, and I need to obtain from this number of page of the document how I could do it. Answer Your question is not quite clear. What do you mean that you have the base64 encoded byte[]? Normally you either have a base64 encoded string or an byte[].

Merge encrypted pdf file programmatically exception

I have been using the following code to merge encrypted pdf files programmatically. I started getting this error recently upon trying to create the pdfReader at this line of code: com.itextpdf.text.exceptions.InvalidPdfException: Unknown encryption type R = 6 at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:738) at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:181) at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:219) at com.itextpdf.text.pdf.PdfReader.(PdfReader.java:207) at com.project.mainPageShop.mergeMyFiles(mainPageShop.java:4368) at com.project.mainPageShop$DownloadFileAsync.onPostExecute(mainPageShop.java:11757) at com.project.mainPageShop$DownloadFileAsync.onPostExecute(mainPageShop.java:11628) at android.os.AsyncTask.finish(AsyncTask.java:755) at android.os.AsyncTask.access$900(AsyncTask.java:192) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772) at android.os.Handler.dispatchMessage(Handler.java:107) at

Remove FixedLeading at the first line on each page

I want to remove setFixedLeading at the first line on each page (100+) I read a bit text(more 100 page with help while). And I set padding and margin to 0 but I still have top indent. Why? Help me pls? How delete it? PDF file: https://pdfhost.io/v/Byt9LHJcy_PDFpdf.pdf Answer At the time of element creation you don’t know the page it

Java iText scale document to A4

I have the following method that “resizes” all the pages of a document to A4 page dimensions: However , this is not working as expected , the pages are being transformed to A4 (297×210) BUT the content is not being fitted inside (scaled) , the content appears cutted because the original pages are larger than 297X210 . How can I

Is there any way to keep whitespaces before text in iText7?

I’ve added a Text object that start with whitespaces to the Paragraph object, but the whitespace of paragraph is removed in iText7(7.0.4). It looks like left trim. Is this a specification of Paragraph? Is there any way to keep whitespaces before text? Answer iText will trim spaces. But it will not remove non-breaking spaces.

How to add border to paragraph in itext pdf library in java?

I have created a paragraph in using itext pdf library in java. I have to add border to paragraph, not to the whole document. How to do it ? Answer Please take a look at the BorderForParagraph example. It shows how to add a border for a paragraph like this: There is no method that allows you to create a

Advertisement