3

I'm trying to create a web script that will allow me to alter PDF templates that I have uploaded and re-output them. I have tried Zend already which allows me to write to a PDF but that means leaving the PDF blank in certain space which is to primitive for what I need. PDFFlip was not any better.

We need to implement functionality so we can remove content from the PDF as well as remove and replace. I have looked at CAM::PDF and changepagestring.pl but I'm not sure it's up to the job. I was hard pressed to find any real usage examples and Perl is not a language I have used before.

This is for a web project but I am flexible with the language we use, ideally PHP or ASP.NET C# would be great. Preferably not Java unless there is no other way.

I should also point out that I looked through the FoxitReader SDK without any luck. I never tried to implement it but I found no mention of find and replace like functionality.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ben
  • 175
  • 1
  • 4
  • 14
  • No idea if it's any good book looks very promising http://www.pdflib.com/download/pdflib-family/pdflib-8/ – DrColossos Jun 24 '10 at 05:53
  • Thanks, I had a pretty good look through that yesterday and while it has a lot of features it doesn't seem to have an out of the box search and replace. It may be possible to bring a few functions together to create one but with it's high out the box price my client would soon be over budget. For the full version it is 3x more than adobe creator. – Ben Jun 25 '10 at 02:51
  • Are you using an input PDF you control? – William Entriken Apr 11 '13 at 17:21

2 Answers2

2

You can tinker with PDF text but it is not straight-forward just to search and replace. The text is designed as an end-file format not for easy editing. I wrote a blog post explaining some of the issues at http://pdf.jpedal.org/java-pdf-blog/bid/12670/PDF-text

mark stephens
  • 3,205
  • 16
  • 19
  • Thanks for you reply, I was aware that PDF was a display format and hard to get text from. I had seen your article posted on this forum when I was doing my research. While it's not a solution to my answer I will up vote as it makes a good read. – Ben Jun 24 '10 at 10:21
0

May be as workaround it's better to hold and fill in templates in some format that is more convenient for editing? E.g., you can keep your templates as Microsoft Word templates and then export them to PDF after filling. This thread may be useful on this way.

PDF file format isn't quite appropriate for editing.

Alternatively, you may prepare your templates as PDFs containing form fields. In this case filling of form fields is common and well-known task and there a lot of pdf components for this.

Vitaliy Shibaev
  • 1,420
  • 10
  • 24
  • The PDF's have been exported from InDesign and are business card layouts. I am unaware if you are able to create form fields that are easier to fill from inDesign? – Ben Jun 28 '10 at 01:57