itext

[iText] Inserting Image onCloseDocument

I'm trying to insert an image in the footer of my document using iText's onCloseDocument event. I have the following code: public void onCloseDocument(PdfWriter writer, Document document) { PdfContentByte pdfByte = writer.getDirectContent(); try { // logo is a non-null global variable Image theImage = new...

iText program not running

program is compiling properly, but it is not running. it gives error classnotfoundexception ..i have already included the library path to the classpath .. ...

itext issue: IE7 showing 404 sorry page title in the tab

hi guys, I am trying to figure out why I'm getting this tab title in IE7. The tab says "We're sorry/(french equivalent)" which is basically our 404 not found page title. The pdf is generated fine and the response status is 200, why is it still redirecting to the 404? The weird thing is its only happening to my machine, my coworker is ...

iText Java disable print pdf

Hi Gurus, We are using the following code to disable Print option in PDF. Works really well. PdfReader reader = new PdfReader("my-old-file.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf")); stamper.setEncryption("my-owner-password".getBytes(), "my-user-password".getBytes(), PdfW...

how to keep same header on starting of next page in pdf

Here is My Code. private void getActionItems(Document document, Chapter chapter, Section section, Paragraph pas) { List drbRefList = null; try { _actionService = new ActionItemImpl(); _aiBean = new ActionItemData(); if (_aiBean != null) { _actionLi...

Using Java and IText, how to extract AcroForm field names from a PDF?

I'm looking for a simple API example, that reads a PDF file / template as an input, and iterates over the fields defined in the PDF form (I think it is called AcroForm) ...

Reading PDF Header content from pages using Itext

I am trying to read out the content from the pages of a PDF file using Itextsharp. I am doing this in order to read out the actual Page number printet in the page header. I have searched the documentation and the web. I can find examples of adding a header but not retrieving and reading the Header of an existing PDF file. Do somebody ha...

Paint Swing Component to PDF using iText

I have a JFrame, which i wish to save as a PDF. How do i paint this JFrame using iText? public PrintFrameToPDF(JFrame bill) { try { Document d = new Document(); PdfWriter writer = PdfWriter.getInstance(d, new FileOutputStream ("sample.pdf")); d.open (); // HOW ? d.close (); } catch...

Does anyone know of a fork of iText?

Now that iText has gone AGPL, I'm assuming someone is going to take the old (2.1.7 or 4.2.0) code and fork it to keep an LGPL version going. Does anyone know of such a fork already started? ...

Create a PDF From a JSP Output

I have a webpage with a export option to PDF. I have to display the contents of the page in the PDF. Currently I use iText PDF Library to generate PDFs. The problem is creating PDF with iText is quite a challenge. Moreover we get frequent layout/UI changes for the webpage, so we have make the same changes to PDF. Is there any way...

iText: setting PDF view defaults

Hi guys, I'm using iText for a bit of manipulating my PDFs through Java, and I'd like to make it so that a PDF default opens so that a single page fits in the window it opens, that this window is preferrably full screen, and that it has a thumbnail view on the lefthand side. I know other programs can set these view preferences, so I ass...

PDF with iText - Center Align Strings

I'm using the iText library for .NET to generate a PDF. I need to output a PDF with an image, which has three text strings positions centered vertically, but absolute Y positions. Each string uses a different font. I've been struggling for hours to find a way to do this, I can get the first line on Ok using SetSimpleColumn(), but further...

Getting the PDF created using iText as pop up in JSF

Hi. I want create a pdf using iText. The method which does this is a JSF bean. What I want is, on click of a commandButton in JSF page, the PDF is created. It must then open as popup in a new window(or tab) keeping the JSF page unaltered. How can I accomplish this ? I know there is a way in javascript in which we can open a new window us...

Drawing a horizontal line to the table at the end of page in iText ?

Hi. I m creating a table using iText. Each table has 2 columns and have no borders except for left most, right most, top most and bottom most side of the table. I am able to achieve this but the problem occurs when new page begins. I want the to draw a horizontal line to the table at the end of page and another horizontal line when it be...

How can I build a document in iText and then write it to disk separately

I'm trying to write a program to benchmark the iText PDF library and I'd like to separate out disk access if at all possible. My plan is to write everything into a Document in memory, then take that document and generate a PDF from it. Trouble is, the only way I can see to write the thing to disk is to use PdfWriter, which needs to be st...

flying saucer (xhtmlrenderer) doesn't bold my font?

Hi all, I'm using a custom truetype font in a pdf generated by flying saucer xhtmlrenderer. ITextRenderer renderer = new ITextRenderer(); renderer.getFontResolver().addFont("myfont.ttf", BaseFont.CP1252, BaseFont.EMBEDDED); renderer.setDocument(XMLResource.load(in).getDocument(), url); renderer.layout(); renderer.createPDF(out); and ...

iText - add content to existing PDF file

I want to do the following with iText: (1) parse an existing PDF file (2) add some data to it, on the existing single page of the document (such as a timestamp) (3) write out the document I just can't seem to figure out how to do this with iText. In pseudo code I would do this: Document document = reader.read(input); document.add(ne...

Documentation for iTextSharp

Can somebody provide a link to documentation (class XML documentation) for iTextSharp ? I tried Google with no result... I only found JavaDoc documentation for iText. Also when I was working with iText I found an extensive on-line tutorial. It was divided to 11 or 12 chapters dedicated to different features from basic and simple ones to...

flying saucer (xhtmlrenderer) out of memory

I'm trying to use flying saucer to create a very large PDF and it seems to be running out of memory. below are a couple of stack traces which suggest to me that flying saucer is not completely scalable... or am i doing something wrong? java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.util.XMLStr...

flying saucer (xhtmlrenderer) requests image 4 times

in my xhtml i have the following: ... <img src="myImage.jpg" /> ... and I render like so: ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(XMLResource.load(in).getDocument(), url); renderer.layout(); renderer.createPDF(out); the resulting PDF is as expected, however I notice that the image (which is included only ...