editing a pdf file using javascript: how to do?
Copy link to clipboard
Copied
just realized that it is possible to edit PDF files using javascript.
I have some, very small, experience in the past writing controls in javascript but honestly I don't know how to edit a pdf file using this language.
I especially don't know where to begin...
May someone help me?
examples and steps to begin are really appreciated 🙂
thanks!
Copy link to clipboard
Copied
Where to start depends on what you mean by editing. If you are thinking you can edit existing page content, you're going to be disappointed.
You might want to start by reading what modifications are possible at the link below.
Copy link to clipboard
Copied
thank you joel for your reply
honestly I hope to be able to modify the content, anyway I also need to add pages (one before, one after my original pdf) and also to save my original pdf as a photo (and probably also other features...)
so, your link is very interesting but how can a beginner like me write something to do that?
indeed i don't know how to start...i would need the steps to follow...
😕
Copy link to clipboard
Copied
You can insert pages and export the PDF as images using scripts.
If you do not know JavaScript at all, take an online class but understand that the techniques used to manipulate HTML are not the same as PDF. Most online courses don't differentiate between the JavaScript Core and the browser extensions. You'll need to basically figure that part out on your own.
Once you understand the basics of the JavaScript Core go to
http://www.pdfscripting.com for some great tutorials
and
Learning to Program JavaScript for Adobe Acrobat - KHKonsulting LLC
Good luck.
J-
Copy link to clipboard
Copied
Hi Joel, still me
soon I will have to give to the collegue the ability to modify PDFs, combining an original pdf file with an header pdf page and a footer one.
So, at least at this stage, it could be feasible, also for a very beginner like me...hope...
I had not yet time to read all the docs you suggested me, will do soon, but meanwhile i'd like to understand a couple of things:
1. the javascript code I will write, where will be saved? and how will I recall it to be launched?
2. they are buying the full (write) version of adobe acrobat, to produce pdf: is it strictly needed or something more light is enaugh? What i exactly need to do that thing?
thanks a lot for your help and patience...
Copy link to clipboard
Copied
1) That depends. JavaScript can be stored in fields, buttons, links, bookmarks, attached to events like page open and close, will print and did print etc. You'll need to read through the documentation and decide which is best for your application.
2) You'll need the Pro version to add JavaScripts and you'll need to pay special attention to what features you program so that you won't try to do something that your audience can't with their viewer. For example, Pro can add fields to a document, Standard can't. Standard can add watermarks, Reader can't. Adding Javascript doesn't turn these features on. JavaScript can only do what the application does.
Copy link to clipboard
Copied
2. Small correction: Acrobat Standard can add form fields. Even Reader can, although it's not simple.
Copy link to clipboard
Copied
Wait. What? Are you thinking from a template? Please elaborate.
Copy link to clipboard
Copied
In Reader? From a template is one option, or by using a script.
Copy link to clipboard
Copied
excuse me, i would need a further clarity about point 1
I write the script and save it in some way in the pdf document on which it has to be lauched or I have to save it into a kind of adobe envirnoment and I can run this script for every pdf?
sorry but really new for me...
Copy link to clipboard
Copied
pdfscripting.com has a lot of good tutorials.

