pdf text manipulation
-
Hi, Does itextSharp support editing an existing pdf file. We have a pdf template file with placeholders for different values that needs to be replaced with the actuals programmatically. Basically kind of "Find and Replace" text values.Is this possible by itextSharp from sourceforget.net or any other pdf writer/generators. TIA
-
Hi, Does itextSharp support editing an existing pdf file. We have a pdf template file with placeholders for different values that needs to be replaced with the actuals programmatically. Basically kind of "Find and Replace" text values.Is this possible by itextSharp from sourceforget.net or any other pdf writer/generators. TIA
If you have questions specific to a particular product, then you need to ask on it's respective site. SourceForge has forums for each projects, so go to the iTextSharp project page and click on "Forums". If that doesn't do what you need it to, there is another article on this site I just read the other day that may: A PDF Forms Parser[^]. There may be others as well, but you just need to search. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]
-
Hi, Does itextSharp support editing an existing pdf file. We have a pdf template file with placeholders for different values that needs to be replaced with the actuals programmatically. Basically kind of "Find and Replace" text values.Is this possible by itextSharp from sourceforget.net or any other pdf writer/generators. TIA
iTextSharp does not provide an option to EDIT an existing pdf file. Here is a quote from their tutorial:
You can't 'parse' an existing PDF file using iText, you can only 'read' it page per page.
What does this mean?
The pdf format is just a canvas where text and graphics are placed without any structure information. As such there aren't any 'iText-objects' in a PDF file. In each page there will probably be a number of 'Strings', but you can't reconstruct a phrase or a paragraph using these strings. There are probably a number of lines drawn, but you can't retrieve a Table-object based on these lines. In short: parsing the content of a PDF-file is NOT POSSIBLE with iText. Post your question on the newsgroup news://comp.text.pdf and maybe you will get some answers from people that have built tools that can parse PDF and extract some of its contents, but don't expect tools that will perform a bullet-proof conversion to structured text.Also,
What iText DOES provide is the possibility to READ a PDF document and copy an entire page of this file into the PDF file you are constructing from scratch. This can be useful if you want to create a new document based on (an) existing document(s). You can add a Watermark, pagenumbers,...
You may want to check out http://itextsharp.sourceforge.net/tutorial/ch01.html[^] Jon G www.Gizmocoder.com