Questions tagged [itext]

2

votes
1

answer
85

Views

Dynamic Height size in footer using iText

I have an HTML code that I'm using in my report footer. However the height of this footer may vary according to the content of my HTML code. Is it possible to do some work to resize the height of my footer automatically according to the size of my code? Footer.java public class Footer extends PdfPag...
1

votes
3

answer
18.4k

Views

Signed PDF showing message “The validity of the document is unknown”, iText

I am using iText to apply digital signatures in PDF. The digitally signed PDF is showing message like 'the validity of the document certification is unknown. The author could not be verified.At least one signature has problems.' at the top. When I add the certificate to my trust identities which is...
Ramasamy
1

votes
1

answer
4.3k

Views

How to easily control spacing height between two paragraphs?

Currently, I am using document.add( Chunk.NEWLINE ); after each paragraph to generate space between two paragraphs. What is the way to generate a spacing of any height I specify? Thanks!
curious1
1

votes
1

answer
484

Views

Extract Pages from a PDF using itextsharp in Powershell

I have been researching this for weeks now and can't seem to make much ground on the subject. I have a large PDF (900+ pages), that is the result of a mail merge. The result is 900+ copies of the same document which is one page, with the only difference being someone's name on the bottom. What I am...
fodelement
1

votes
1

answer
13.4k

Views

Searching words in PDF and Extracting it using iText in android

I recently downloaded iText 5.3.3 and i'm having a bit of a trouble using it. What classes do i use to Search Words and Extract them from the PDF and display the text in Android? I have seen the class PdfTextExtractor, i want to know in the class there is a method with a parameter of TextExtractio...
Christian
1

votes
0

answer
114

Views

how i can save itext image to image file (jpg)?

Is there a way to save the com.itextpdf.text.Image file as a jpg file on the SD card in android? I am creating an image from template and i want the image to be saved on the SD card. Any help is appreciated.
Aliasghar Yousefian
1

votes
0

answer
249

Views

signer information does not match signer information Bouncycastle and jboss

I have a problem when I try to sign my pdf document, I'm using a keystore to sign but I change it many times and now jboss show me this message Failed to define class org.bouncycastle.asn1.ASN1ObjectIdentifier in Module 'xx.earxx.war:main' from Service Module Loader: java.lang.SecurityException: cla...
Illidan
1

votes
0

answer
76

Views

iText duplicates /Popup annotations when copying pages

When using the following code to copy annotated pages, iText 7.1.0 duplicates the /Popup annotation, the only difference between the 'original' and the duplicate being that one has a /Parent entry and the other doesn't. Unfortunately, the one without the missing /Parent is registered in the /Annots...
Thomas W
1

votes
0

answer
40

Views

How to add a hyperlink into sticky note in ITEXT 5?

I have sticky note text comments added using annotation = PdfAnnotation.CreateText( stamper.Writer, rect, 'Some title', 'blah blah https://www.google.com blah blah', false, 'Help' ); stamper.AddAnnotation(annotation, page); Is it possible to turn https://www.google.com in the content into a hyperlin...
JasonY
1

votes
0

answer
58

Views

PDFX Compliance error - OutputIntent profile not 'prtr'

Using iTextSharp 5.5.0 we embed Watermark text to PDF documents that are compliant with PDF X4. The output PDF when analyzed with Adobe Acrobat Preflight fails for PDF X4 compliant with below error: OutputIntent profile not 'prtr' Any suggestion for fixing this issue with iTextSharp will be helpful....
Brin33
1

votes
1

answer
171

Views

iText pdf timestamp validation returns false, why?

Im using iText 5.5.10 to validate timestamp in pdf file. Can someone explain me, why calling pkcs7.verifyTimestampImprint() method returns false? Java code is from iText 5 example site, see C5_02_SignatureInfo.java as input file use testpdf_timestamp.pdf. Code: public static void main(String[] args...
Radek Kantor
1

votes
1

answer
220

Views

Change pageSize of pdf before saving

I receive a pdf as a byte[]. When I save this binary as pdf, pageSize is too big. I want to change the pageSize in the code. Currently I am trying it this way, based on what I found in other questions: using iTextSharp; using iTextSharp.text; using iTextSharp.text.pdf; using (MemoryStream stream =...
xtra
1

votes
0

answer
66

Views

a special character “\u9d28”(鴨) in SourceHanSerifTC-Light cannot show in PDF

the Code is in followings PdfWriter dest = new PdfWriter('o.pdf'); PdfDocument pdf = new PdfDocument(dest); Document document = new Document(pdf); string chFontPath = 'c:\\windows\\fonts\\SourceHanSerifTC-Light.otf'; PdfFont font = PdfFontFactory.CreateFont(chFontPath, PdfEncodings.IDENTITY_H, false...
James Wu
1

votes
0

answer
267

Views

Getting the color of the text using iText

My current project involves extracting meaningful information from PDF documents. To achieve the final objective, I have been trying to extract the forecolor of the text. I present a snapshot from one of the documents. The color of the encircled text comes out as Black. I suspect that I am going wro...
Sau001
1

votes
1

answer
230

Views

Copy into new document and fillout form in iText7 c#

I have been trying to get a grip of iText7 c# with little luck. My goal is: Load a pdf (one page) with a form (multiple fields) as a template Fill out the form, Flatten and copy the filled forms page to a new document repeat #2 x number of times with different data Save to Memory Stream I have the d...
LooC
1

votes
0

answer
407

Views

How to set a new different font while converting HTML to PDF using ITEXTRenderer

I am trying to convert a HTML into a PDF. In HTML i have some symbols which are not showing up in PDF document. While debugging i found that ‑ or ‑ character is not available in any of the default fonts available in the IText library. My HTML doesnt have Arial Unicode MS in its font famil...
DarkKnight1010
1

votes
0

answer
370

Views

CSS alternative/equivalent of display: table, table-row-group, table-row, and table-cell?

I have strange problem to overcome which I'll explain why I need to overcome it below if you're interested. But, essentially, I need to apply CSS that gets the EXACT same effect as each of the following on Divs : display: table; display: table-row-group; display: table-row; display: table-cell; Perh...
Tamer Rifai
1

votes
1

answer
28

Views

Itext Sharp Report is not able to generate the Report For more than 37000 records

I have tried to build the pdf For more than 37000 records but I am getting system out of memory exception and I have also tried after deploying the same in Staging server but getting time out ,I also increased the time out in the Web.config but not able to produce the report.Can Anyone help on this....
PANKAJ TIWARI
1

votes
0

answer
52

Views

Itext Android PDF cell size issue with Html

Facing a problem while generating pdf from html template using Itext in android. Have used com.itextpdf.tool:xmlworker:5.5.10 & com.itextpdf:itextg:5.5.10. The problem is, itext create every cell of same size in pdf but in html cell size is different. also tried size in px instead of percentage, but...
Gaurav
1

votes
1

answer
313

Views

Updating annotations of a PDF using a program coded in C#

I am able to extract annotations present in a PDF page using iTextSharp. However, I am not able to edit these annotations. My requirement is that among multiple annotations I can search a specific annotation and then edit its content and save the PDF. On the opening of the PDF, the updated version s...
Darsh Thakkar
1

votes
1

answer
59

Views

How to determine which radiobutton was selected using iText?

To manipulate radiobuttons with iText, I know how to get field names and using AcroFields.getAppearanceStates to get their possible values. But I just couldn't find any method to determine which option was selected. Is it a missing feature in iText?
IT SEARCHER
1

votes
0

answer
97

Views

How to save chart image to a PDF with good resolution?

using (MemoryStream stream1 = new MemoryStream()) { Paragraph p2 = new Paragraph(new Chunk(new iTextSharp.text.pdf.draw.LineSeparator(0.0F, 100.0F, iTextSharp.text.Color.BLACK, Element.ALIGN_LEFT, 1))); pdfDoc.Add(p2); pdfDoc.Add(new Phrase('\n')); pdfDoc.Add(new Phrase('\n')); PieChart.SaveImage(st...
ahmed_khudhair
0

votes
0

answer
2

Views

Convert Url/WebRequest to PDF via Itextsharp

I have a pdf statement that is generated always to a static url (/pages_pm etc. etc.). Using that url I would assume I can make a web request, convert that request to byte[] then create a the pdf. However I continue to get a PDF Header signature not found. Here is what my code currently looks like:...
GustavMauler
1

votes
0

answer
112

Views

downloading blank pdf pages with itext and ACJRuntime.jar

I have an xml file and .doj template file. trying to download a PDF using itext.jar and ACTRuntime.jar. It is working in java 1.6 and Websphere 7 but after migrating to java 8 and websphere 8, it is just downloading blank white pages in PDF format. Below is the code that I'm using to produce PDF. pu...
Venkata
1

votes
0

answer
67

Views

Page layout structure with multiple asp.net chart controls in iTextSharp

I have multiple chart dynamically created and attaching to pdf. Currently there are printing one on one line. I want to achieve something like this. . I want to create a container with some background and add columns like container in it. byte[] GetBarChartImage(params int[] points) { using (var str...
Ghazanfar Khan
1

votes
1

answer
186

Views

How to define an object apparently implemented as a static read-only field? (Using iText 7 to convert multi-page TIFF to PDF)

I'm writing a program in PowerShell that uses iText 7 DLLs. I use a DLL disassembly tool, IText DLLs, and iText sample/example C# code and convert the sample C# code to PowerShell code. For example: iText Sample code PdfWriter writer = new PdfWriter(dest); PdfDocument pdfDoc = new PdfDocument(write...
Nova Sys Eng
1

votes
1

answer
28

Views

This code for Horizontally displaying the text in pdf, how do I change it into vertically on my pdf pages

This code for Horizontally displaying the text in pdf, how do I change it into vertically on my pdf pages private void stampPdf(InputStream source, OutputStream dest) throws Exception { PdfDocument pdfDoc = new PdfDocument(new PdfReader(source), new PdfWriter(dest)); Document doc = new Document(pdf...
1

votes
0

answer
55

Views

How to invoke a checkbox events on loading a fillable pdf form using ITextSharp?

I have a fillable pdf form and while creating this pdf form, we have added some javascript in the change events of some text fileds. After saving the form using c# and open it from a different location, the javascript actions and style does not shown. It shows only after any mouse change event or te...
Sujith MB
1

votes
0

answer
86

Views

How to add a Pdfptable little by little to a document when generating a Pdf from a Html

The application I'm working on generates pdf reports from html files using itextsharp library. Apparently, when large tables are generated, itextsharp allocates a lot of memory (~300 MB for a 200KB file). A solution to this problem is adding the table little by little to the document (so all existi...
Liviu Nicoara
1

votes
1

answer
153

Views

Extract PDF content failed using iTextSharp because of special fonts

I can extract content from most PDF files with the following code. PdfReader pdfReader = new PdfReader(Path); for (int page = 1; page
HuangKai
1

votes
1

answer
303

Views

Android How to set margin top on table using itext

I created an android application with export pdf option and use itext plugin for creating pdf documents. I want to set table margin-top attribute because it shows on top of the document. Should I add paragraph between logo and table or is there other solution? Here is my code: private static void c...
Zeljo
1

votes
1

answer
289

Views

Generate Html to Pdf using ItextSharp blank file generate

I am using Itexsharp.dll for generate html to pdf with webapi and angular 2, but I am return bytes array from webapi and open bytes in angular 2 with Blob but when open pdf it was blank. My code is here IN Web api code: - HttpResponseMessage response = new HttpResponseMessage(); MemoryStream workSt...
Urvish Patel
1

votes
1

answer
66

Views

How to convert an image (rgb/gray) inside a pdf to monochrom/bitonal one using itext and java

I'm writing a java programm to swap images inside a pdf. Due to the process of generation they are stored as high dpi, rgb images, but are bitonal/monochrome images. I'm using itext 7.1.1, but also testet the latest dev version (7.1.2 snapshot). I'm already able to extract the images from pdf and c...
Schloppe
1

votes
1

answer
665

Views

Conversion of HTML( with inline css) to PDF using itext 2.1.7

I want to convert one html page to pdf using itext 2.1.7. I have used HTMLWorker to convert the html file, but it not taking the inline css which I have used in the html. Below is my code snippet . Can anyone help to fix this issue.. PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOu...
user3132347
1

votes
1

answer
72

Views

watermark to pdf not working perfectly

I have the code to create a watermark when the user uploads the file. the watermark is created in the middle page and the footer page. but my problem is the watermark work is not perfect depending on the contents of the uploaded file content. for more details try to note the image below : And this i...
achmad darmawan
1

votes
0

answer
344

Views

java.security.InvalidKeyException: No installed provider supports this key: (null) while verifying signed pdf

i am getting this exception on PdfPKCS7 pkcs7 = fields.verifySignature(name); this is the complete code import com.itextpdf.text.pdf.AcroFields; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.security.PdfPKCS7; import java.io.IOException; import java.security.GeneralSecurityEx...
ak22shay
1

votes
0

answer
90

Views

the type or namespace common could not be found

I have error 'the type or namespace common could not be found' im using iTextSharp 5.4.4 What is the problem here? Please help im looking for this solution for days... using (FileStream msReport = new FileStream('Ima se moze se', FileMode.Create)) { //step 1 using (Document pdfDoc = new Document(P...
Milan Srdić
1

votes
0

answer
25

Views

how can we keep two cells of a table together without leaving some part of any page blank

I want to keep two cells of a table keep together. So as per below code i gave cell as keep together. I gave here example for two inner tables actually there are more. So if both heading and content cell are not able to fit in the page then it starts from next page. But requirement is part of page...
ashish pal
1

votes
0

answer
65

Views

Open a PDF at a logical page number

I've searched high and low for a way to open a PDF at a 'Logical Page Number' but so far haven't found any solution. What I mean by 'Logical Page Number' is the following (highlighted): I've tried using the following calls directly over an URL, but none of them work: example.org/doc.pdf#nameddest=R5...
Dan Hall
1

votes
1

answer
102

Views

java:convert HTML to PDF failed to process <strong> and <em> whth itext

I want to convert html to pdf with itext in my java code,but it seems that the strong tag and em tag don't work.I try to search solutions in the network and tracing my code to find out why,but failed.Here are my java code , my html file and generated pdf snapshot below. public static boolean html2p...
elaine

View additional questions