Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

editing a pdf file using javascript: how to do?

New Here ,
Nov 06, 2017 Nov 06, 2017

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!

TOPICS
Acrobat SDK and JavaScript , Windows
11.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2017 Nov 06, 2017

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.

Acrobat DC SDK Documentation

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2017 Nov 06, 2017

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...

😕

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2017 Nov 06, 2017

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-

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2017 Nov 09, 2017

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2017 Nov 09, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2017 Nov 09, 2017

2. Small correction: Acrobat Standard can add form fields. Even Reader can, although it's not simple.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2017 Nov 09, 2017

Wait. What? Are you thinking from a template? Please elaborate.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2017 Nov 09, 2017

In Reader? From a template is one option, or by using a script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2017 Nov 09, 2017

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2017 Nov 09, 2017
LATEST

pdfscripting.com has a lot of good tutorials.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines