I want to be able to:-
1. add a small piece of text on each page of an existing document, and
2. possibly, at a later stage when I only have the modified document, to remove that piece of text.
I have successfully implemented part 1 by means of:-
PdfCopy.PageStamp stamp = copy.createPageStamp(page);
PdfContentByte over = stamp.getOverContent();
ColumnText.showTextAligned( ... );
I'm trying to use iText to manipulate a dynamic PDF; I want to take any subforms that have content on them and show them, and then I want to create a flattened PDF out of it.
Alternatively, I would like to take the above and create a static PDF. If I know what fields to show and which ones to hide, can I get positions from the XFA XML and recreate the form using AcroForm fields as an AcroForms PDF?
I'm trying to get a good handle on XFA manipulation of forms using iText.
Thanks for the help.
Heres what I am trying to do; I would appreciate to know if this is possible in iText.
I'm not interested in constructing pdfs only deconstructing existing pdf's for analysis of content and positions of words on the page.
Rather than boundary of all text on the page I want the boundary info for each word in order to generate some xml for another program I wrote.
Something like this...
<word id="0" x="0" y="0" width="8" height="4">The</word>
<word id="1" x="12" y="0" width="7" height="4">fox</word>
I have recently purchased the book and am doing very lite iText work. All I am doing is reading in an existing PDF document that has fields. Then I fill those fields with text supplied by my application. This works just fine with English text.
I am referencing itextpdf-5.3.0.jar, text-xtra-5.3.0.jar, and itextasian-1.5.2.jar
Here's the issue I am seeing:
1. I am developing on the Mac (OS X Lion)
2. When the field text is English or Japanese (I suspect same will happen for an CJK language) I am seeing the field text in the preview just fine.
My duty is: find all kinds of attachments in pdf files
After studying the examples I was able to detect the document-level and page-level attachments
But how do I detect the filename of attachments that are organized in a portable collection?
In the listings 16.9 - 16.14 is described how to create portable collections.
I could not found any stuff about analyzing the content of a portable collection.
where is a way to print pdf using itext or i have to use itext to create and one other tool to print it ?
Looking in the internet i found a example using a lib com.lowagie.tools.Executable.printDocument, but it appears too old...
I have itext 5.2.1 version
I've created a document using the chapter and section API, so 'bookmarks' are automatic and everything flows as I add content to a section and sections to the chapter(s).
Then I ran into a memory issue with Tables. The solution was in the book using the PdfpTable's setComplete(false) method. HOWEVER, the book notes and testing proves this only works when you add the table to the Document as you progress and it does NOT work with sections or chapters.
SO, either I have to give up on chapters and sections and use a lower level method of getting the same 'look'
the following code should set the cell alignment but has no effect. The text shows up left and bottom aligned. Am I missing something. I am new to iTextSharp.
Thanks in advance.
static public void CreatePDF(Stream stream)
Document document = new Document(PageSize.LETTER);
document.SetMargins(72, 72, 72, 72);
I want to absolutely position an image on a page. The image shows up but the AcroForm fields are obscuring the image. How do I push the image to show up over the form fields?
Here's the current code being used via a PHP/Java Bridge:
$outfile = '/home/me/pdf/public/pdfs/OUT.pdf';
$output = new java('java.io.FileOutputStream', $outfile);
$pdffile = '/home/me/pdf/public/pdfs/IN.pdf';
$imgfile = '/home/me/pdf/public/images/img.png';
$PdfReader = new java('com.itextpdf.text.pdf.PdfReader', $pdffile);
I am currently experimenting with the free version of iText, but we plan on licensing if does what we want.
Synopsis: We need to run through an existing PDF, looking for paragraphs containing given text, and then copy the rendered paragraphs to an output document, highlighting the text that was found.