Skip to main content
Inspiring
Aug 27, 2021 6:19 AM UTC
Answered

Add a footer and run action

Hi.

 

I'm considering performing the following processing automatically for multiple files in different folders.

(1)Using Edit PDF -> Header & Footer -> Add to insert page number in specified font at the center of footer and
change the margins(top,bottom,left,right)
(2)run a custom action to protect the pdf file.

I tried inserting the page number using "addField" as below through IAC, but I donn't know which the property to change the margin and
it seems that the page number inserted using "addField" is different with the result of (1) process.
-------------------------
Set acroFooter = jso.addField(CStr("xftPage" & i - 1 & 1), "text", i - 1, Array(bStart, 30, bEnd, 15))
acroFooter.Value = "Page: " & i + 1 & "/" & TotalPages
acroFooter.textSize = 6
acroFooter.ReadOnly = False
acroFooter.Alignment = "center"
-------------------------

Because it is possiable to add a new action that executes the process of (1) and I have to execute the (2) action ,
so I thought about to execute the action using javascript, but I coundn't find the way to execute a action.
There is a way that using the "AutoBatch" plug-in" which allows users to execute any existing Action Wizard "action", but it's not free.

So...
(1)Do I have to create a plugin for these processes?
(2)If yes, which API can be used to insert footer and execute a action?I coundn't find the API to insert footer.
(3)If no, what kind of processing should I do?

 

Please give me any idea.
Thank you.

 

 

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Aug 27, 2021 8:21 AM UTC

1) No. You can use the Action Wizard, if you have Acrobat Pro. But you have to trigger it manually, or by using a plugin like AutoBatch.

2) You can use various JavaScript commands to do it, such as addField, or addAnnot, or even addWatermarkFromText.

Each one works a bit differently and has its own set of parameters. You can read all about them in the Acrobat SDK.

6 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Aug 27, 2021 8:21 AM UTC

1) No. You can use the Action Wizard, if you have Acrobat Pro. But you have to trigger it manually, or by using a plugin like AutoBatch.

2) You can use various JavaScript commands to do it, such as addField, or addAnnot, or even addWatermarkFromText.

Each one works a bit differently and has its own set of parameters. You can read all about them in the Acrobat SDK.

Translate
erieru103Author
Inspiring
Aug 31, 2021 8:21 AM UTC

Hi, try67!

 

Thank you for your reply.

When I use addField to insert a footer, the footer cann't be updated by using Edit PDF -> Header & Footer -> update.

What kind of the object is the footer which inserted by using Edit PDF -> Header & Footer -> Add Header & Footer?

Translate
try67
Community Expert
Community Expert
Aug 31, 2021 8:30 AM UTC

Correct. It adds a field, not a watermark.

 

When you use that command it adds a type of layer (Optional Content Group), and you can't edit it after it's added (at least not using a script).

Translate