itextsharp

Avoid saving new file on the disk

I am using ASP.NET 3.5 with iTextSharp and I have the following code: var templatePath = Server.MapPath(@"~/Templates/template1.pdf"); var newFilePath = Server.MapPath(@"~/TempFiles/new.pdf"); PdfReader pdfReader = new PdfReader(templatePath); PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFilePath, FileMode.Create...

iTextSharp and VBnet question about headers

Hello! I'm wondering how can I put a header into my pdf file, cause i've tried the tutorials from here: http://itextsharp.sourceforge.net/tutorial/ch04.html And it have not worked. Ive done this: Dim head As New HeaderFooter(New Phrase("This is page: "), False) head.Border = Rectangle.NO_BORDER document.Header = head But VS2008 say...

Load PDF from Memory ASP.Net

I am using ITextSharp to generate pdf on the fly and then saving it to disk and display it using Frame. The Frame has an attribute called src where I pass the generated file name. This all is working fine what I want to achieve is passing the generated pdf file to Frame without saving it to disk. HtmlToPdfBuilder builder = new HtmlToP...

C# iTextSharp: How to specify Spot Colors

I am using iTextSharp to add text to PDF files. The Text Color is usually specified as CMYK, but will require the need to specify spot/special colors. There is an example here In the Line: PdfSpotColor spotColour = new PdfSpotColor("PANTONE 100 CV", 0.5f, new GrayColor(0.9f)); Does anyone know the description and meaning of the par...

iTextSharp custom paper size

Hi, I'm using iTextsharp library to create PDF files. I can declare for A4 Landscape paper like this: Dim pdfTable As New PdfPTable(9) pdfTable.WidthPercentage = 100 Dim pdfDoc As New Document(PageSize.A4.Rotate()) I'm wondering how I can set Height of pdfTable or A4 Height manually. Because there's a lot more margin left at the bot...

How to add a blank page to a pdf using iTextSharp?

I am trying to do something I thought would be quite simple, however it is not so straight forward and google has not helped. I am using iTextSharp to merge PDF documents (letters) together so they can all be printed at once. If a letter has an odd number of pages I need to append a blank page, so we can print the letters double-sided....

iTextSharp renders image with poor quality in PDF

Hello, I'm using iTextSharp to print a PDF document. Everything goes ok until I have to print the company logo in it. First I noticed that the logo had poor quality, but after testing with several images, I realize that was the iTextSharp rendering it poorly. The test I did to say this was to print the PDF using my code and then edit t...

iTextSharp - SelectPages Method Flattening Form

I've written an application to process a big load of PDF's by parsing data from a CSV file. The problem I've got is that I want to save the first page of the PDF and the first page only. When I use PdfReader's reader.SelectPages("1") it causes the form fields to be flattened. If I comment it out, everything works fine. Any ideas why ...

Reading PDF content with itextsharp dll in VB.NET or C#

How can I read PDF content with the itextsharp with the Pdfreader class. My PDF may include Plain text or Images of the text. ...

iTextSharp 5.0: Tables with rounded corners

I was wondering what would be the best approach for creating tables in a pdf that have rounded corners using the iTextSharp library. Thanks ...

Need help with creating PDF from HTML using itextsharp

I'm trying to crate a PDF out of a HTML page. The CMS I'm using is EPiServer. This is my code so far: protected void Button1_Click(object sender, EventArgs e) { naaflib.pdfDocument(CurrentPage); } public static void pdfDocument(PageData pd) { //Extract data from Page (pd). string intro = pd...

Add Javascript to pdf using iTextSharp

Dear All, Is it possible to add javascript to a pdf (open event) using itextSharp? I tried using pdfwriter and PdfAction.Javascript() and it does add the javascript however, the annotation information in the pdf is lost. Is it possible to add javascript using pdfcopy so that the annotation information is preserved? Thanks in advance, ...

iTextSharp is missing HeaderFooter class

This is weird, I am currently using iTextSharp and I want to add a Header & Footer to my PDFs. In all the examples they simply create a new HeaderFooter() object. However, I have iTextSharp libraries all imported but the HeaderFooter is not defined. I've used Reflector to see if I can find out whereabouts the class is and its missing?!...

How can I use delegates to call styling methods?

I need to style a ton of different elements (read: "cells") in a PDF using iTextSharp. Label, header, subheader, number, etc. Right now, I'm using three different methods for each cell type: public static PdfPCell GetDefaultCell(string strText) { PdfPCell cell = new PdfPCell(new Phrase(strText, GetDefaultFont())); ce...

Merging/filling pdf form file with xml data

Hello, Let's say I have a pdf form file available at website which is filled by the users and submitted to the server. On the server side (Asp.Net) I would like to merge the data that I receive in xml format with the empty pdf form that was filled and save it. As I have found there are several possible ways of doing it: Using pdf for...

How to set PDF paragraph or font line-height with iTextSharp?

How can I change the line-height of a PDF font or paragraph using iTextSharp? ...

Extracting image from PDF with /CCITTFaxDecode filter

Hi there, I have a pdf that was generated from scanning software. The pdf has 1 TIFF image per page. I want to extract the TIFF image from each page. I am using iTextSharp and I have successfully found the images and can get back the raw bytes from the PdfReader.GetStreamBytesRaw method. The problem is, as many before me have discov...

How to get text font in pdf

Hello i am using itextsharp and i am trying to get all the fonts of the given string in pdf file is this possible if it can be done in any language i please tell me Thanks ...

referencing files that were included with vb.net solution

my application builds a pdf with images in the solution explorer i added a folder called pics and dropped all the images there when i run the program from my computer, there are no problems, but when i had a different user install the application they get this error: here's how i am including the image: Dim jpeg2 As Image = Image.G...

ITextSharp - text field in PdfPCell

Hi, I'm using iTextSharp to create a PDF, how can I add a textField into PdfPCell? Thank you so much ...