itextsharp

Problem with HTMLParser in Itextsharp

I am using Itexthsharp for coverting html to pdf now my problem is that i m using htmlparser to convert html page to pdf but the problem is that htmlparser just convert first line to pdf all other line from html file is not converted to pdf Here is the code Document document = new Document(); final = new Document(); ...

Unacceptable performance rendering PDF Tables with ITextSharp and PDFSharp

I am trying to generate PDF files containing large numbers of tables. Each PDF could potentially be 150 pages in length. When using ITextSharp, the file sizes are up to 16 megabytes and have no noticeable shrinkage when zipped. When using PDFSharp, the file size is very reasonable at 2 or 3 megabytes but it takes an unacceptable l...

Problem with coordinate system and displaced Text in different PDFs using iTextSharp

Hello everyone, I'm working with iTextSharp and .NET 3.5 SP1 (in C#, as you can guess) and modify some existing PDFs using the PdfStamper class. Now I've got two problems: Transforming the coordinate system As I see it, iTextSharp is using (postscript?) points as unit of measurement, but I'd like to transform these coordinates to mill...

iTextSharp Verticle Spacing Question

Hi, I'm using iTextSharp to generate some PDF files. I have two tables which have content, and I want to put some space between the two tables, say the equivalent of 1 line of text (using the same font as the tables around the space). Below is the code I'm using to add the two tables. What I cannot figure out is how to place a vertical...

checkmark when pdf signed with iText

I'm signing PDF's using iText. I'm including a graphic in the signature. This works, but the green checkmark (or yellow question mark) that shows when the document is verified interferes with the graphic I inserted, making the end result look ugly. Is there a way to manage the size of the green checkbox - are there any properties - fonts...

iTextSharp.dll limitation

Hi, I am using iTextSharp.dll in my windows application, with iTextSharp i am password protecting the PDF file, its working fine for files less than 20,000kb. But when i am trying to password protect large files is above 20,000kb its throughing an exception as "PdfReader not opened with owner password". Code: Stream input = new FileSt...

Trying to open up PDF after creating it with iTextSharp, but can't get it to work?

I have a button when clicked, inserts text into form fields in a pdf and saves the filled pdf to a directory. When I am done editing the pdf, I want to open the pdf in the browswer, but Process.Start() is not working. Is there better way to immediately show the pdf after it has been generated? Here is the code for the button: protec...

iTextSharp & Windows

Is there a way to convert from iTextSharp Document class to System.Drawing.Printing.PrintDocument in c# so i can give print facilities to user? thanks ...

iTextSharp HTMLWorker img not found 404

Hi, i got the problem that the HTMLWorker.ParseToList function will throw an exception ( 404 - not found ) when a tag like: <img alt="none" src="/image.jpg" /> has a deadlink in the src... i'd like it to just not load the image and go on... Does anyone now a way to configure this or has similar solution in mind? ...

How to get Text Field rotation with iTextSharp

What I need to do is query an iTextSharp AcroField to check if it is rotated, and if so capture the value of the rotation. So If I have the following field: Dim af As iTextSharp.text.pdf.AcroFields = stamper.AcroFields Dim afi As iTextSharp.text.pdf.AcroFields.Item afi = af.GetFieldItem("fieldName") What do I need to do to get the ...

Save pdf template file to new pdf file after edit text in asp.net

I have pdf file contains some text to replace with another text and save the file with new name. Can I do that with iTextSharp? and how? Can you give me guid for it? ...

How to Add image in pdf using C# and iTextSharp?

I need your help adding an image to a PDF I'm using: string imgPath2 = localPath + "\\TempChartImages\\" + LegendPath; img2.Save(imgPath2); ith.WriteImage(imgPath2, 80); But this code give me error : "Use of unassigned local varible img2" How can I solve this error? ...

PDFs are not displaying apostrophes in field data inserted by iTextSharp.

I am using iTextSharp to fill pre-defined fields on an existing PDF document using the folowing syntax: PdfStamper stamper = new PdfStamper(reader, stream); stamper.AcroFields.SetField("A","O'Henry"); stamper.FormFlattening = true; stamper.Close(); Unfortunately, apostrophes (and likely other forms of common punctuation) are not dis...

iTextSharp Creating a Footer Page # of #

Hi, I'm trying to create a footer on each of the pages in a PDF document using iTextSharp in the format Page # of # following the tutorial on the iText pages and the book. Though I keep getting an exception on cb.SetFontAndSize(helv, 12); - object reference not set to an object. Can anyone see the issue? Code is below. Thanks, Rob pu...

Can iTextSharp open an RTF document, manipulate it, and export the document to PDF?

Using iTextSharp (and c#/ASP.NET) is it possible to open an RTF document, manipulate it by replacing some text, insert an image (WMF or PNG), and the export that manipulated document to a PDF document that retains the formatting of the original RTF document? Essentially I'm hoping to create a simple mail merge solution with the template...

How to resize a pdf using iTextSharp

I have a bunch of PDFs that I'm just trying to open, resize the page, and then save. I'm also hoping that the file sizes will shrink significantly doing so. I am using iTextSharp and the resizing works just fine, but the file size is nearly identical, ever so slightly larger in fact. Here's the function I have now: Dim reader As ...

itextsharp - the name rtfwriter does not exist in the current context

I'm trying to convert XML docs into rtf documents. I can successfully perform xml to pdf conversions, but whenever I attempt to use RtfWriter.GetInstance or RtfHeaderFooters I get an error message saying that 'the name rtfwriter does not exist in the current context' - I can't seem to access any of the rtf assemblies Has anyone enc...

PDF text position, page left margin

I want to write an application to validate a PDF file. The validation that is required is to verify that all the text and images in the PDF should start after 0.5" margin from left and 0.5" margin from the right. If any of the text is going outside this margin then application should be able to catch this. I tried to search this into iT...

Will iTextSharp work with Bitmap objects not generated from a file?

I want to create and insert a lot of images into a PDF and iTextSharp looks promising for this. Their tutorial discusses adding a .net Bitmap object to the document, however, the Bitmap they use is one generated from an existing supported image file. Can iTextSharp take a Bitmap object that is directly generated by a graphics object? Th...

ItextSharp and PDftable

I have situation and I seek solution for that. I have an application (.net) that generates PDF file in that pdf file we have some pages as portrait and some are landscape. I rotate the pages to fit the requirement. We are having issue when printing this document, problem is that the header of landscape page is printing on the right han...