Link to home
Start Free TrialLog in
Avatar of tombombadilll
tombombadilll

asked on

Show new serial number in pdf everytime it opens?

Hi

I have a pdf-dokument that I would like to put a serialnumber in...e.g. in the upper right corner.
Every time someone opens the pdf document a new number should come up.

...so the first time anyone open it the number should be 1...then 2...3...4...and so on.

How can I accomplish this?
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

That is almost impossible to do.
Will all your users use the full version of Acrobat? Will all of them be connected to the Interent when they open the PDF for the first time? If you can answer "Yes" to both of these questions, then you have a small chance that you can make it work.

What you need is a server that hands out serial numbers. These numbers can e.g. be requested by SOAP. SOAP however is something that only works with the full version of Acrobat.

Would the serial number be stored in the file after it's opened for the first time? If so, you need to force a write operation - potentially against the user's will (which is generally not a good thing to do).

Why do you need to add a serial number when the document is opened? In my opinion, it would make more sense to assign a serial number before the file gets distributed, so that you can keep track of it. That's something that is relatively easy to do with a tool that can stamp the pages of a PDF before you e.g. deliver it via the web browser.
Avatar of tombombadilll
tombombadilll

ASKER

Ok, som the best way to do this is to create the pdf with e.g. PHP (pdflib) and there write out the pdf with a new serial number every time...

I think the pdf will be in a shared folder on a LAN and every time somebody open the file it should get a new serial number. The serialnumber can be stored where ever its best... =)

All the users will not have Adobe Acrobat installed...

With just the free Reader as client application, this is impossible to do.

You don't have to create the PDF from scratch every time it's opened, just take a "normal" PDF, and then use a tool that can stamp existing pages. I am not familiar with any PHP tools to manipulate PDF files, but I'm pretty sure that you can find a tool that fits your needs an your budget.

Again, why do you want to do that? Do you want to track how often the file is opened, or do you want to track different "versions" of the document (even though the actual document is still the same, but the serial number is different)? If you can describe the reason why you need to do this, we may be able to offer a better way of accomplishing that goal.
Ok, a stamp tool seems to be the solution? Any suggestions which?

I don't really know why but I think it is because they want to open the pdf, fill it with text and then save it and then it has a unique number.
OK, let's take a step back: You cannot save a PDF with Reader. You can "reader enable" PDFs with (expensive) server tools from Adobe, or by using a 3rd party service (e.g. formrouter.com), but your standard PDFs will not be saved in Reader after you fill in form fields. If that is a requirement, you need to look for a different tool set. All that Reader can do is to submit the filled form to a server. You could assign the serial number on the server once the filled form is received, and then send back the complete form with the serial number to the client. This way, the client can print the form with the serial number.

To stamp a PDF, you can either write your own based on a library like iText (http://www.lowagie.com/iText/) or it's .NET version at http://itextsharp.sourceforge.net/. Or, you can buy a solution. There are too many packages out there, and what you need depends on what environment you are running in. Take a look at teh PDFStore (http://www.pdfstore.com/list.asp?Action=Search&SearchString=storepdftoolsforumgeneral&Keyword=stamp). I've used Appligent's Stamp PDF Batch a few years ago, but I don't know if they've updated their software since then - the Acrobat plug-in Stamp PDF has definitely not been updated for a few years.

Ok, now I have checked how this will be used. All the users will have Adobe Acrobat installed so they will be able to save the pdf with fill in form fields.

...and when the user fills the form fields with data and then SAVE the pdf the serial number should be increased with 1. If you open it and don't save it...the serial number shouldn't be increased.

The environment will be windows and the pdf will be on a shared directory on a server.

Hope this make it easier for you to help me. :)
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok...good! :)

Do you have any links to where I can read more about this?

I have a lot of experience in JS but not with ADBC... Have not looked at the AcroJS guide but will do that.
Thanks!
YOu can find the Acrobat JavaScript Scripting Reference -(that's the AcroJS document from above) and the Acrobat JavaScript Scripting Guide here:  http://partners.adobe.com/public/developer/pdf/topic_js.html

That's all the documentation that's available.