PageBorder | Show your Clients the Limits! [UPDATE]
October 02, 2021 | Snippets | en | fr
Update (2-Oct-2021). — Version 1.28 of PageBorder fixes a UI problem in InDesign CC (the option for removing the border once created was hidden.) Tip: if you need to customize the color of the border (defaulted to Black
), simply replace the name assigned to the strokeColor
property, Line 26 of the script.
Need to have a page border on your job up until it goes to the printer? PageBorder quickly creates a temporary customizable black border around the active page, or every page, of your InDesign document. The script is compatible with ID CS3, CS4, and even CS5 which allows multiple page sizes per document.
A few years ago, Cari Jansen wrote the useful 1pt Stroke All Pages script for InDesign CS and CS2. Cari's code creates a rectangle on each page, set to exact page size, with fill None and stroke 1pt Black. The object is placed in a separate layer, so that it can easily be removed/disabled by the user. That's exactly what PageBorder does, except that it provides a user interface with some extra features and supports InDesign CS3-CS5.
The most important change is that we now need to support multiple page sizes per document —through the Page.bounds
property. This involves resetting the rectangle size within the page loop, as shown in the below snippet:
var createBorder = function(/*Layer*/layer) //------------------------------------------------ // this: Page [collective allowed] { var pages = this.getElements(), alignMode = StrokeAlignment[alignStrings[align]. toLowerCase()+'Alignment'], pg; var recProps = { fillColor: 'None', strokeColor: 'Black', strokeTint: 100, strokeWeight: ptBorder, strokeAlignment: alignMode, strokeType: (jDots && jDotsStyleName) || solidStyleName, }; while( pg=pages.pop() ) { recProps.geometricBounds = pg.bounds; pg.rectangles.add(layer,undefined,undefined,recProps); } };
So InDesign CS5 users can apply PageBorder on this kind of spread:
PageBorder Dialog and Settings
PageBorder displays a simple dialog to let you manage a few settings. (Note that these settings are session-persistent, so the script always starts from the last configuration.)
• The Weight field allows you to set the stroke weight of the page border, from 0.1 to 5 pts. You can explicitly enter any unit, e.g. "0.3 mm". The default unit is point (pt) for CS3/CS4 users. In InDesign CS5, the default unit is the one defined in Edit > Preferences >Units & Increments > Other Units > Stroke.
• The Alignment listbox lets you choose how to align stroke over page boundaries: Inside, Outside, or Center.
• Check All Pages to apply PageBorder over the whole document. Otherwise, only the active page is processed.
• Check Dotted Stroke to get a dotted border using the “Japanese Dots” stroke type.
• The script always creates the border in a dedicated layer called PageBorderLayer, which is automatically locked. You don't need to handle or remove this layer by yourself, because the script manages it:
— To update the border(s) at any time, rerun PageBorder, adjust the settings, and press OK.
— To finally remove the border(s) when your document goes to print, run PageBorder, check Remove the border, and press OK.
• See also:
— Review and Demo of PageBorder in French (Urbanbike).
— Review on Cari Jansen's blog.
— Review on DesignGu.ru (in Russian).
— The script is mentioned on InDesignSecrets: “This Week in InDesign Articles, Number 41”.
• Special thanks and credits to: Jean-Christophe Courte, Stéphane Georis, David Blatner, and of course Cari Jansen for the original idea.
Comments
Et un de plus made in "Marc Autret" dans la palette ! Décidément, je ne compte plus tout ce que je te dois. Merci.
Great job Marc!
Merci beaucoup !
Comme quoi, Marc, les petits scripts basiques de cet acabit rendent de gros, très gros services au quotidien…
Bon, je ne peux toujours pas choisir la couleur ;-) Nouvelle version demain…?!
NB : je précise que c'est une blague, Marc serait bien capable de l'ajouter…
comme d'habitude, excellent travail!
Just wondering if it would be possible to combine this wonderful script with the built in Cropmarks.applescript.
ie.
Your script runs first to make the page border with no weight with Align Stroke to Centre then it would continue on and select that border and apply the Cropmarks.applescipt all done on its own layer, then delete the border leaving just the crop marks.
These two tasks are something I have to do many times a day usually by drawing the border then running the cropmarks script.
Hi - great script.
Is it possible to set the black border "not print"?
@ all
-------------
Thanks for your comments and suggestions.
@ Kevin
-------------
Yes, merging PageBorder with the Cropmarks script wouldn't be a problem. However in that particular case I don't understand the purpose: since page borders fit the entire page area, why not using the native “Mark & Bleeds” settings in the Print —or PDF Export— dialog?
@Matz
-------------
We have two options: (a) setting every single page border to nonprinting, or (b) setting the whole PageBorder layer to nonprinting.
Then, when printing or exporting the document WITH page borders, the user will have to set the Print/Export layers to “Visible layers”, and/or to include “Non-Printing Objects.”
What do you think is the best option?
@+
Marc
Hi, Marc.
I prefer setting every single page border to nonprinting and set the export to include “Non-Printing Objects".
I use Export presets for screen-pdfs (include “Non-Printing Objects") and other presets for high-res-output (not include “Non-Printing Objects").
Yes you are correct I could use the automatic crop mark settings in Indesign.
But I and the printers that I output film for prefer larger crop marks ie: a setting of; Line Length of 42pt a offset of about 8pt and a weight of 0.25pt plus as I print straight to a imagesetter it is good to have the crop marks there on the page along with registration marks and colour bars. It is a bit of a bad habit of mine to not rely on software to do stuff like this.
Question: With a script is it possible for it to make indesign crash in any way even if you are not using that script. Like your page border script I named it "1 Pageborder.js" so that it would be listed at the top of the script list. Not understanding how scripts work could this cause a problem.
Hi Kevin,
Do you mean that renaming "PageBorder.js" to "1 PageBorder.js" makes InDesign crash at startup? Weird!
What ID version? What OS?
@+
Marc
Not so much that it is but is it possible that it could, Indesign is crashing a bit for me and was trying to slim down the possibilities of why this was happening.
OK. What is theoretically possible is that a STARTUP SCRIPT causes InDesign to crash at startup, because that kind of script is actually launched during startup —provided you drop it in the "Startup Scripts" folder. Same thing for extensions, plug-ins, or extra SWF panels (%InDesign%/Plug-Ins/Panels).
But a simple script cannot run itself.
@+
Marc
Yeah thought that was the case, Ok removed scripts from Startup Scripts only one in there was the Equalizer Script, pity really looked like a good helping script, Indesign is more stable now, My machine just does not seem to like that particular script. Thank you for your help in this matter.
Oh, bad news for me! Does Equalizer, alone, make ID instable?
In CS4?
Really bad news, sorry for that.
@+
Marc
Uncertain, CS4 still crashes on me so may not be your script, I am not able at this stage to find out exactly what is doing it and can only spend a small amount of time per day trouble shooting it.
On the bright side for you, the computer I am on has been here for a long time and some real idiots have been playing with it, I should really reinstall but I have this OSX 10.5.8 communicating with a Power Mac 7300/200 running OS 7.5.5 (RIP for AFGA SelectSet Avantra 25E) which I was told could not or is not supposed to work, So very reluctant to reinstall.
So all that said don't take my word for it that your script is making indesign CS4 crash.
After much ado it seems Preflight has something to do with crashes. Have turned preflight off and indesign crashs no more, Have to turn it on at end of job to check things but then turn it off again. Wonder if anyone else is having this problem CS4 6.06 on a PowerPC G5.
I've used this for some time in CS3 (Middle Eastern version) on a PC, with no problems. Today I installed it on a different PC, also running CS3 ME, and it will not work. I get the following Script Alert:
ReferenceError: TextWrapModes is undefined
The odd thing is that it does create the new layer and when I run it again it offers to remove the border, despite the fact that there is no border. Have tried all 3 position choices, and various weights.
I have to get this layout sent to a client right now, so I just made my own frames and don't have time to try anything else today. In the future I'll just remember to use the other computer where I know it works.
Great script, by the way.
Thanks.
Hi Olaf,
You're right, the script cannot work properly in InDesign CS3!
In the CS3 Scripting DOM, 'TextWrapModes' was called 'TextWrapTypes', and 'TextWrapPreference.textWrapMode' was called 'TextWrapPreference.textWrapType'.
I will fix this.
Thanks,
Marc
Done!
PageBorder 1.27 should be CS3 compatible.
@+
Marc
Thanks!
I thought I'd had it working in CS3 on another computer, but maybe I was imagining it.
Glad to know that (contrary to recent trends) the problem running the script wasn't something wrong with ID or my computer.
Thanks again,
Olaf
a colleague of mine noticed an unwanted side effect of pageborder.js and it has to do with the textwrap panel. that is, if the pageborder script is run while the textwrap panel is set to any option other than none, all text items on the page disappear. took us a while to work out what was going on. now that we know that, we make sure that the textwrap panel is set to none, but is there a way to modify the script to ensure that the boxes applied by the script do not apply a textwrap?
Hi Colin,
> If the pageborder script is run while the textwrap panel
> is set to any option other than none, all text items on
> the page disappear (…)
Really? Are you using PageBorder 1.27? This issue was supposed to be fixed.
What version of InDesign?
Thanks for your report anyway. I will investigate on this problem.
@+
Marc
je suis tres desole. j'avais version 1.4. J'ai téléchargé v1.7 maintenant, tout c'est excellent!
in case my french is bad, i'm really sorry, i had v1.4. just downloaded 1.7 and all is great!
Thanks! This is so helpful for those customers who are not so print savvy (ex "What's a crop mark?)
I was using a generic box in the Library, but that had to be resized and I had to create a new layer. This is far better.
One thought: Could the border by applied to the Master page?
Hi Mike,
Thanks for your comment.
> One thought: Could the border by applied to the Master page?
In fact, that was my first idea when I created the script. Technical reasons made me give up this solution—but I confess I don't remember which!!
@+
Marc
The Page border script is a wonderful script for stand-alone documents. I was wondering whether it could be tweaked so that it can apply or remove the page border to all documents which are in the book panel in a single stroke. At present we have to open each document & add the page border or remove it individually. I currently use it in CS4 with Windows.