PageBorder | Montrez les limites à vos clients ! [MÀJ]
October 02, 2021 | Snippets | fr | en
MàJ (2-Oct-2021). — La version 1.28 de PageBorder corrige un problème d'interface signalé sous InDesign CC : la case à cocher permettant de supprimer le(s) cadre(s) de page nouvellement créé(s) était inaccessible. Astuce en passant : vous pouvez personnaliser la couleur du cadre (noir par défaut) en changeant le nom affecté à la propriété strokeColor
, ligne 26 du script.
Il est pratique de fournir à son client, avant l'envoi du job définitif à l'imprimeur, un PDF de contrôle ou un tirage papier faisant apparaître le contour des pages du document de travail. PageBorder pour InDesign crée en un clin d'œil un cadre temporaire, personnalisable, autour de la page active ou même de toutes les pages de votre maquette. Ce petit script est compatible avec ID CS3, CS4 et même CS5 — autorisant plusieurs formats de page au sein d'un même document.
Il revient à Cari Jansen d'avoir inauguré il y a quelques années un script très utile, 1pt Stroke All Pages, pour InDesign CS et CS2. Le code de Cari génère un rectangle transparent, doté d'une bordure noire épousant parfaitement les bords sur chaque page du document cible. L'objet étant placé sur un calque dédié, il est aisé de le désactiver ou de le détruire en fin de parcours. PageBorder procède exactement de la même façon, sauf qu'il propose une petite interface d'appoint pour customiser notre affaire et qu'il est compatible avec les dernières versions d'InDesign.
Du point de vue du script, le principal réquisit introduit par CS5 est que nous devons désormais nous soucier du fait que les dimensions de page — calculables via Page.bounds
— sont susceptibles de varier au sein d'un même document. Cela nous impose de redéfinir minutieusement la propriété geometricBounds
du rectangle à l'intérieur de la boucle qui va traverser les pages. C'est ce qu'illustre le fragment de code ci-dessous :
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); } };
Ainsi, les utilisateurs d'InDesign CS5 pourront utiliser PageBorder dans ce type d'environnement :
Interface et paramètres
PageBorder affiche une boîte de dialogue contrôlant une toute petite poignée de paramètres. (Notez que ces paramètres possèdent une persistance de session, c'est-à-dire que le script démarre toujours en tenant compte de vos derniers réglages.)
• Le champ Weight permet de définir l'épaisseur du contour, de 0,1 à 5 pts. Vous pouvez saisir explicitement d'autres unités de mesure, par exemple "0.3 mm", sachant que l'unité par défaut est le point (pt) sous CS3/CS4, tandis que sous InDesign CS5 elle se conforme à vos préférences pour les contours, nouvelle option rangée dans Edition > Préférences > Unités et incréments > Autres unités.
• La rubrique Alignment permet de choisir le mode d'alignement du contour vis-à-vis des bords de page : Inside (intérieur), Outside (extérieur) ou Center (centré).
• Cochez la case All Pages pour appliquer PageBorder à l'ensemble des pages du document. À défaut, seule la page active sera décorée.
• Cochée la case Dotted Stroke pour obtenir un contour en pointillés (utilisant alors le style « Points japonais » de la palette Contour).
• Le script crée le cadre bordant sur un calque dédié intitulé PageBorderLayer, lequel est automatiquement verrouillé. En principe vous n'aurez jamais à manipuler ou à supprimer ce calque par vous-même, puisque PageBorder s'occupe de tout :
— Pour mettre à jour la bordure à tout moment, relancez le script, ajustez les options et validez.
— Pour finalement supprimer la bordure avant le départ à l'impression, lancez le script, cochez la case Remove the border et validez.
• Voir aussi :
— Présentation de PageBorder sur Urbanbike.
— Présentation sur le blog de Cari Jansen (EN).
— Présentation sur DesignGu.ru (RU).
— Mention dans InDesignSecrets (EN).
• Remerciements chaleureux et crédits à : Jean-Christophe Courte, Stéphane Georis, David Blatner, sans oublier Cari Jansen pour l'idée originale.
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.