[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

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?
0
tombombadilll
Asked:
tombombadilll
  • 5
  • 4
1 Solution
 
Karl Heinz KremerCommented:
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.
0
 
tombombadilllAuthor Commented:
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...

0
 
Karl Heinz KremerCommented:
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.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tombombadilllAuthor Commented:
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.
0
 
Karl Heinz KremerCommented:
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.

0
 
tombombadilllAuthor Commented:
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. :)
0
 
Karl Heinz KremerCommented:
In this case, you can use a database to keep track of the serial number:

Adobe created ADBC, which is their JavaScript interface to ODBC. This allows you to create a JavaScript routine that can update a table in a database (e.g. in your case the last serial number used). You need to run this routine at the time the user clicks on the submit button (or, saves the document). Do you have any experience with JavaScript in general, or Acrobat's JavaScript implementation? Have you looked at the AcroJS guide that's available from Adobe's web site yet?
0
 
tombombadilllAuthor Commented:
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!
0
 
Karl Heinz KremerCommented:
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.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now