1 Reply Latest reply on Feb 18, 2016 5:56 AM by Karl Heinz Kremer

    customized script

    Marchinio80

      i want develop a customized script that will process all of the prices in the file (anything with the Euro symbol) and overlay them with the new price (double the original one).

        • 1. Re: customized script
          Karl Heinz Kremer Adobe Community Professional

          Based on the screenshot you've posted in your first question (https://forums.adobe.com/thread/2071241?sr=stream&ru=1759946), I assume that this is just a normal page from a catalog, without form fields. This makes it much harder and potentially impossible to do this via a script. It is much easier to go back to the original file (which you say you don't have) and make the changes there. Because you don't have access to the original file, I would try to convert the file to e.g. a MS Word file with Acrobat's export filter and see if the resulting file is usable. If it is, I would use that to make my changes and then convert back to PDF. If this all fails, then I would try to come up with a script that finds the Euro amounts. This is a rather complex job, and unless you have experience with JavaScript development, I would not recommend you attempt this. A while ago I wrote up a tutorial about how to find text in a PDF file. You would have to use the same approach initially, but once you know that you've found the text you are looking for, you would then use the Doc.pageGetNthWordQuads() method to get the location and size of the item, and then add a text annotation with the new price right in that spot. At the end, you will have to flatten your document to convert these annotations to static PDF content.

           

          Let me add one other thought: If you don't have the original file, it's probably fair to assume that this is not your file, and in that case, changing information in something that does not belong to you might not be a good idea to start with.