1 Reply Latest reply on Aug 11, 2011 12:31 AM by maxwyss

    Can you automate a PDF to change its contents every time it is downloaded?

    csweets01

      I would like to create a coupon / voucher document that when people download it, it changes the coupon code every time it is downloaded.

      I purchased an online shopping cart that allows you to upload digital documents so that when it is purchased, it sends them a link to the PDF. This is great except like i just stated, it would be great if I only had to upload one PDF that auto changed itself every time someone downloads it..

      Any ideas if this can be done with the new Acrobat Pro X?

      Or is it possible using an HTML doc?

      I am not a code person, so any help would be appreciated.

        • 1. Re: Can you automate a PDF to change its contents every time it is downloaded?
          maxwyss Level 4

          It depends on how strict your code has to be and other properties of the code, as well as whether you allow multiple use of the document after being downloaded.

           

          If your code's task is to "be unique", and your document is reusable after being downloaded, all you need to do is to add a text field, and to add this line of code to the pageOpen event:

           

             this.getField("myCodeField").value = new Date().valueOf() ;

           

          and that will provide you an unique code. Any Adobe Acrobat/Reader with JavaScript enabled will be able to create a code on the fly, when the document is opened.

           

           

          If, on the other hand, your code has to be sequential, and strictly controlled, and being displayable by even the crappiest PDF viewer, you will need a server-side solution. There are libraries which allow you to add variable data at run time, and there are products which do the same (such as StampPDF by Appligent). The way you go will depend on your programming capabilities and your budget. This server-side solution would also allow you to insert a barcode, if you want.

           

          Hope this can help.

           

          Max Wyss.