Skip to main content
Participant
October 16, 2017
Answered

Rectangle all PDF s

  • October 16, 2017
  • 2 replies
  • 2258 views

Dear members

I'm using Adobe Acrobat Standard DC version 2017.012.20098. It is intented to provide  all the pages (total 500 pages) of a rectangle (around the page). Same rectangle, some color, etc...

In total there are 500 pages.

The rectangle of page 1 is a exact copy for the other page 499. Now we do this manually. Is there a easy way to perform this?

Thank you

Greetz

This topic has been closed for replies.
Correct answer try67

You can use this code to do it:

for (var p=0; p<this.numPages; p++) {

    var pageRect = this.getPageBox("Crop", p);

    this.addAnnot({type: "Square", page: p, rect: pageRect, width:5, strokeColor: color.red, opacity: 1, readOnly: true, lock: true});

}

Play around with the width value to get wider or narrower frames.

If your files doesn't contains other fields or comments you can run this command at the end of the process to convert the square comments into static graphics:

this.flattenPages();

2 replies

Dave__M
Community Expert
Community Expert
October 16, 2017

One trick that I have used in the past is to make a jpg file that is the box.  Then, in the Edit PDF toolset, I go to the 'More' tools, and add a Background:

You can tweak the position, size, etc. before applying it.  You can even specify to what pages the image is added.

I hope this is helpful.

My best,

Dave

Participant
October 16, 2017

Dear Dave

Thanl you for you response.

Bellow is the paper that i use (500 times) and the RED rectangle i insert this from tools.

Based on the following (see bellow-that's what I wanted - The red rectangle I insert this from tools then rectangle.). how will my JPG file look like .Where and how is this JPG file created?

try67
Community Expert
Community Expert
October 16, 2017

Do you mean like a black frame around the edges of the page? It's possible, but if you want it to not be interactive then you need to flatten the file after adding it. Does your file contain any form fields or comments?

Participant
October 16, 2017

Dear try67

Thank you for you respons.

Yes for example a red frame.

I start by inserting a rectangle on page 1. I do this by inserting "rectangle" with tools. This rectangle appears on the full edge of the page. I can choose in the rectangle properties for the color ( black, red, etc..) Now I have to do this 499 times.

yes its a paper (pdf) with some text and technical stuff. But around the page its white. How is it possible do this?

Below is the paper and the red frame is exact what i want.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 17, 2017

You can use this code to do it:

for (var p=0; p<this.numPages; p++) {

    var pageRect = this.getPageBox("Crop", p);

    this.addAnnot({type: "Square", page: p, rect: pageRect, width:5, strokeColor: color.red, opacity: 1, readOnly: true, lock: true});

}

Play around with the width value to get wider or narrower frames.

If your files doesn't contains other fields or comments you can run this command at the end of the process to convert the square comments into static graphics:

this.flattenPages();