Questions tagged [itext]

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
1

votes
0

answer
164

Views

iTextSharp XMLParser.Parse throws and swallows exceptions repeatedly

I have a function which I am using to try to give iTextSharp some HTML and from it generate a PDF. This function successfully generates the PDF, complete with CSS styling, but it is not running fast enough for our requirements. I have noted the one area in particular which is taking a long time to...
Matt Arnold
1

votes
2

answer
125

Views

Creating PDF file in Java

I'm trying to create PDF file from HTML using Java. I've added two jar files. itextpdf-5.1.0 xmlworker-5.5.6 My code: import com.itextpdf.text.Document; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.tool.xml.XMLWorkerHelper; String emailBody = ' This is my Project '; OutputStream file...
Dhaval Goti
1

votes
0

answer
50

Views

Not printing characters like 'Č' 'Ć' in my Culture

I changed culture to my, Serbian Latin, culture, so i can have characters 'Č' 'Ć' Thread.CurrentThread.CurrentCulture = new CultureInfo('sr-SP-Latn'); Anybody knows why? Im using iTextSharp 5.1 for making pdf
1

votes
1

answer
144

Views

iText or iTextSharp: when i use the ‘PdfStamper’ , target file use adobe.reader Verify signature failure

i want remove the last signature and other signature also can use adobe.reader verify_sign success. the original file is signed and use adobe.reader verify signature success,but when i do this code(i not remove the signature), the target file use adobe.reader verify signature failed. but when i...
xuelang0204
1

votes
0

answer
100

Views

After LTV Certification Signature, PDF shows “Document has been Changed”

I have been working with iText and GlobalSign to do digital signatures and Certification on PDF files for the past few months and stuck with one problem. When I just do signing on pdf and then try to enabled LTV it works perfect without any problem but when I do Certification Signing and then try to...
1

votes
0

answer
58

Views

NumberOfPages returns only 1 page and not the 16 pages of the PDF

I need to read the values in a PDF file which has 16 pages. I did not create the PDF file. The form starts on page 3, the two first pages are just text. The version of my iTextSharp DLL is : 5.5.10.0 When I run this line of code (vb.net) : Dim pdfReader As New PdfReader(pdfTemplate) The pdfReader....
DoumB
1

votes
0

answer
36

Views

itextpdf xmlworker PdfPageEventHelper.onGenericTag usage

I am using below dependency for html to pdf com.itextpdf.tool xmlworker 5.5.6 Need to use a custom/generic tags, for that I need to define a chunk and then a generic tag, that is doable using iText but needs to be done through html. Can anyone please help me out with when onGenericTag method will ge...
Niranjan Kumar
1

votes
0

answer
20

Views

how to identify “reply” annotation in itext

I am using itext to extract annotations in pdf, however I am not able to differentiate replied annotations.... Currently I am using PdfName.IRT which returns a string.. but I don't know how to get the annotation to which it is replied to...please find the code below: public static void main(String[]...
atul bharadwaj
1

votes
0

answer
71

Views

GetAppearanceStates() in itextsharp

Im getting possible values of checkbox from a dynamic pdf(pdf is uploaded by user at runtime)using GetAppearanceState(). But how to refer the off value and not based on array nos as suggested by @Bruno Lowagie comments on below post. Reference : Checking off pdf checkbox with itextsharp The Off val...
afreen
1

votes
0

answer
47

Views

Remove space between images added into a single pdf file with iText using java.

I am trying to crate PDF files from a list of images. 4 image should cover a full page with no margin padding or anything. My problem is that the added images are separated by a white line, and I can't figure out a way to remove this separation. public ByteArrayOutputStream createMultiTicketPdf(Lis...
1

votes
0

answer
134

Views

How optimize time while sign pdf with iTextsharp

I am using iTextsharp 5.5.13.0 to sign pdf files with a smart card (X509Certificate2) in a C # project. The process of stamping the signature is fine, but the time it takes to sign is much more than in an earlier version that was had for this process (iTextsharp 4.1.2.0). Previously, it took no more...
Josh S.M.
1

votes
1

answer
84

Views

Generating a PDF with two parallel tables

I am attempting to dynamically generate a PDF using iTextSharp with a SQL table of phone book data. My program can currently generate a table with all of the wanted data. Each page of the PDF only has one long table running down the middle though. I am attempting to format the PDF to have two tables...
Jacob Mich
1

votes
0

answer
390

Views

ASP.NET MVC iTextSharp, is it possible to dynamically generate PDF File in code-behind?

So I am currently using iTextSharp to generate PDF Form Document and so far the way I've been doing it is Create Word Document and Export to PDF. Then use software such as Adobe Acrobat Reader to add Form Textbox into it and give property or ID to the Text box for example '#StudentName' After that,...
Sarah
1

votes
1

answer
42

Views

how my code execution dependent on staging server

I'm using itextpdf for coverting html to pdf in my application. it is taking a lot of time to parse. so we figured that when we start up our staging server it takes normal time otherwise it takes lot of time to parse. I don't understand how is it possible that my local and production server depende...
Arihant Jain
1

votes
0

answer
42

Views

How to add Custom Keystroke event for a combobox using Itextsharp and Javascript?

I have a pdf form , and I dynamically add a combo box to this existing pdf form using Itextsharp. On the change event of the combo box, I need to update the selected value of combo box to a text field. This is the script I need to add to the custom keystroke event of the combo box. if (!event.willCo...
Sujith MB
1

votes
1

answer
43

Views

Why I can not find reference to iText document?

I added the itextpdf-5.5.4 jar file in my project but still I cant not find reference to the methods of the library. getContentPane().add(tPanel, BorderLayout.CENTER); Document d = new Document(); I can only find reference to the Document class of javax.swing.text.
Sudipto
1

votes
0

answer
58

Views

Itextsharp- charts recognition in PDF

Can i count charts in pdf using iTextSharp? I've made code for finding images, but charts are saved in some diffrent way (for example MATLAB charts). Can i do it in some way with iTextSharp ? BTW. My main goal is to delete all images and charts from pdf.
1

votes
1

answer
516

Views

Some HTML and CSS styles not applied when creating PDF document by iText

I'm having an issue with iText when generating PDF from HTML. I'm passing the 'import information section' from Locize, which contains bold tags and list bullet \n Toll-free (within Canada and the USA): 1.800.xxxxxxx\n \n The pdf file is generated in Confirmat...
Julie C.
1

votes
0

answer
541

Views

How to convert a color pdf or images to black & white or grayscale pdf using itextsharp?

When I am trying to convert colored pdf or images to black & white or grayscale pdf iTextSharp in C# WinForm application, it's not working, it also has issues with transparent images. While conversion it turns background in black for transparent images. I am using following code to convert to pdf fi...
yadavr
1

votes
1

answer
25

Views

ItextSharp horizontal aligning issue with fixed Y cordinates

I am using ItextSharp lib for writing pdf. I have to print the name of the student on a pdf certificate template. I am not able to center align the student name with fixed y co-ordinate. private byte[] CreatePDF2(UserCourseViewModel userCourse) { PdfReader reader = new PdfReader(new RandomAccessFil...
Scorpio
1

votes
0

answer
76

Views

Get HTML entities when using iTextsharp to export Gridview to PDF

I faced a problem when I using iTextSharp to convert Gridview to pdf. See this gridview on page, which works fine: but after converting to pdf, you can see & is converted to & and blank to   What should I do to make the pdf parse right text, but no html entities? PS: The data contain chinese so I h...
Hecxer
1

votes
1

answer
92

Views

How to hide table element while converting HTML to PDF using iTextSharp?

I am using iTextSharp and passing raw HTML code to it since my HTML is dynamic. I wanted to hide a table element using 'display: none' or 'visibility: hidden'. But the output still prints the table. Any idea how to hide it? public static HttpResponseMessage PrintToPdf(PdfPrint HtmlContent, string do...
1

votes
1

answer
21

Views

How to bring default pdf opener option in android studio 3.1.1

I have made an app for converting images to pdf, which opens the pdf via the pdf opener present in the device. The problem i am facing is that, if there are multiple pdf opener present in the device, the 'remember me' option is not showing. Is there any method programatically via which i can enable...
1

votes
0

answer
37

Views

Content of PDF needs to overflows to next page with same structure

I am using itextsharp v 5.5.13 to create PDF documents. One scenario where I need help is where the PDF document has a structure (header, body and footer like a template). The idea is to populate data only in the body section. Whenever there is overflow of data to next page, the data goes into the...
Tarun Batta
1

votes
1

answer
449

Views

HTML content convert to PDF using ASP.NET

I am using the ItextSharp module to convert the below listed HTML in to a PDF page for email Here is the code of Html Chief Complaints jyj, 23233, 5556565, 5555, 555, 55, iuye, jyrgtr, test2, Test, Backache, RTA, Follow-up case, Difficulty in walking, Paraplegia, Parapa...
aparna rai
1

votes
1

answer
76

Views

iText - how to replace page and preserve bookmark

I want to replace a page from the targetDoc with a page from the srcDoc, however, I cannot find a way to preserve (or recreate) the bookmark (and the bookmark's position in the document's outline). The original page was pointed to by a bookmark in the document outline and I want this bookmark to sta...
tomazz
1

votes
0

answer
80

Views

Word wrap in Footer template in Itextsharp

I'm facing issue in footer while generating the PDF through itextsharp. I've tried by creating template and also directly through content byte. While generating through content byte, it is overriding the other footer template which is showing the page number of the pdf. If I try using the template,...
Praveen
1

votes
0

answer
40

Views

Merge all the PDFs that been generated

I am developing a web application and one of its features is to generate a multiple certificate in a PDF file. There's no problem in generating a pdf but what I want to happen when generating a multiple certificate is to be in one pdf file only. I am just a beginner so I don't have much idea on doin...
JM Villaflores
1

votes
1

answer
45

Views

Ordered lists with “start” attribute in iText [duplicate]

This question already has an answer here: Converting HTML to PDF using iText 1 answer In a project of mine, I have a functionality that converts an HTML text into a PDF file. I use iText 2.1.7 for that, more specifically the HTMLWorker class. By the way, users can also put ordered lists () in that,...
Andrea

View additional questions