Pay once, no subscription. Free updates.|Try PowerScripts free|Install / update
PowerScripts Help

Site Tools


pdf_export

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
pdf_export [2026/10/25 02:27] – Markup fix for the DokuWiki upgrade (spaces inside bold/italic) 0.0.0.0pdf_export [2026/10/25 02:53] (current) – Help pages updated for PowerScripts 3.8 (help pages session) remoteuser
Line 1: Line 1:
 ====== PDF Export ====== ====== PDF Export ======
  
-In a production environment, you want to quickly export PDF files of single artboards or entire documents without having your document renamed. This script lets you export to PDF using presets, and intelligently name the exported file using the original linked file name, the document color mode, the artboard name and the PDF preset name used and more.+Export PDFs of single artboards or whole documents in one click, with your PDF presets, without your document being renamed. The PDF is named for you from the document name, the artboard, the colour mode, the preset, the date and more, and saved where you want it.
  
-==== PDF Options ====+[[https://o2creative.co.nz/shop/PDF_Export_PowerScript_for_Adobe_Illustrator|See it in the shop]] · Version 2.3.7 · Needs PowerScripts 3.8.38 or later
  
-  *   **PDF Preset** - We recommend creating some custom PDF settings in Illustrator for your workflow, Such as a PDF setting dedicated for printing or proofing, you can set these in Illustrator in the  [EDIT > Adobe PDF Presets...] Menu +===== Where to find it =====
-  *   **Run spell checking before creating PDF**- Better to be safe! +
-  *   **Preserve Illustrator Editing Capabilitie**s - If turned off, will reduce the size of the PDF  +
-  *  **Secure with password** - Stops the PDF from being used and uses the password set in the Settings tab. //Note that passwords in PDF files are not 100% secure; there are online tools to bypass passwords. This should be considered a deterrent, such as hindering the printing of a low-resolution proof but not protecting the artwork from copying.// +
-  *   **Open PDF after export** - Opening the PDF in the computer's default reader after export +
-  *   **Open Folder after export** - Opens the destination in Windows Explorer or OSX Finder. +
-  * **Copy filenames to Clipboard after export** - Once the files as successfully exported copy the filenames to the clipboard, If you want to copy the full filename including path see the history below+
  
-==== Artboard Range ====+Open the PowerScripts panel (**Window > Extensions > PowerScripts**) and choose **PDF Export** from the **Tools** scripts. The script has three tabs: **Options**, **Conf Strip** and **Settings**.
  
-Select the pages to be exported.+===== Quick start =====
  
-==== Additional Marks ====+  - Choose a **PDF Preset**. 
 +  - Under **Artboard Range**, choose what to export, for example **Active Artboard**. 
 +  - Under **Save To**, choose a **Location**, for example **Working Folder** (next to your Illustrator file). 
 +  - Press **Export PDF ...**.
  
-Add an additional confidence strip to check for consistent printing.+===== Options =====
  
-The artwork scale setting only affects the scale of the marks, it does not scale the PDF file.+==== Options ====
  
-==== Save To====+{{:pdf_export:options_tab.png?380|The Options tab}}
  
-Choose a Location where to save your PDF+=== PDF Options ===
  
-==== Javascript ====+  * **PDF Preset**: the Illustrator PDF preset to use. Make your own presets for print and proofs in **Edit > Adobe PDF Presets...**. 
 +  * **Run spell checking before creating PDF**: better safe than sorry. 
 +  * **Preserve Illustrator Editing Capabilities**: untick for smaller PDFs. 
 +  * **Secure with password**: protect the PDF with the password on the **Settings** tab. PDF passwords aren't completely secure (there are tools to remove them), so treat this as a deterrent, for example on low-resolution proofs. 
 +  * **Open PDF after export**, **Open Folder after export**. 
 +  * **Copy filenames to Clipboard after export**: ready to paste into an email or job sheet.
  
-You can run Extendscript (Illustrator's built-in version of Javascript) to modify the file and path. Your code will be wrapped in a function, so ensure that you include a return statement with the required data structure.+=== Artboard Range ===
  
-  * Return an array with the find and replace values such as [{ find: "ABC", replace: "123"},{find: "Cat", replace: "Dog"}], which will be applied to the filename template +  * **Export**: the **Active Artboard**, a **Custom Range** (for example ''2-4''), **All Artboards**, or **Artboards with Selected Artwork**. 
-  * Return false to cancel without error +  * **Export as separate files**: one PDF per artboard.
-  * Return string to show as an error.+
  
-**Variables passed your code** +=== Additional Marks ===
-  * 'path' is the destination path. +
-  * 'filename' is the filename template. +
-  * 'index' is the current artboard index. +
-  * 'range' is the page range being used. i.e '2-4'+
  
-**Functions** +Add a printer's confidence strip to the PDF (see [[printer_confidence_strip|Confidence Strip]]): the **Strip**, its **Position** (**Left** or **Right**), and **Add Spot Color Swatches**. **Artwork Scale** only changes the size of the marks, not the PDF. Set the strip's size on the **Conf Strip** tab.
-  * Call getData(variable) to get the standard data from the table below, such as getData('doc.filename')  +
-  * Call setPath(path) to change the destination path +
-  * Call setFilename(filename) to set the filename template (overwriting the existing filename template)+
  
-Example +=== Save To ===
-<sxh javascript; >+
  
-// This example will extract the ID number from a filename and  +  * **Location**: the **Last Exported to Folder**, the **Documents Folder**, a **Fixed Location** (**Folder**), the **Working Folder** (where your document is), or a **Sub-Folder** of it (**Sub Folder**, made if it doesn't exist).
-// save the  PDF to a master folder based on the ID in the X: drive +
-// "Example filename "Customer F123246 Test File.pdf"+
  
-// Get the current document filename+=== Javascript === 
 + 
 +For automated workflows: **Run Extendscript Code** to change the folder and file name with your own code, and **Test** it. 
 + 
 +  * Your code is wrapped in a function, so finish with a ''return'': 
 +    * a list of finds and replaces for the filename template, for example ''[{find: "ABC", replace: "123"}]'' (or ''[]'' for none), 
 +    * ''false'' to cancel without an error, 
 +    * or some text to show as an error. 
 +  * You can use ''path'' (the destination folder), ''filename'' (the filename template), ''index'' (the artboard number) and ''range'' (for example ''2-4''). 
 +  * ''getData(name)'' gets any value from the filename table below, for example ''getData('doc.filename')''. ''setPath(path)'' changes the folder, ''setFilename(filename)'' replaces the filename template. 
 + 
 +Example: save into a folder named after the job number in the file name ("Customer F123246 Test File.ai"): 
 + 
 +<code javascript> 
 +// get the document's file name
 var docName = getData('doc.filename'); var docName = getData('doc.filename');
  
-// Use a Regular Expression to get the ID+// find the job number (an F followed by digits)
 var matches = docName.match(/F(\d+)/); var matches = docName.match(/F(\d+)/);
 if (matches) { if (matches) {
Line 63: Line 68:
 } }
  
-return 'Can not find a valid ID in the filename';+return 'Can not find a valid job number in the filename'; 
 +</code> 
 + 
 +=== Filename === 
 + 
 +  * **Prompt for filename**: show the save box with the name filled in. Untick to save straight away. 
 +  * **Allow sub folders to be created**: a ''/'' in the template makes a folder. 
 +  * **Insert**: add a code to the template. **Reset** goes back to the default. **Examples** gives ready-made templates, such as: 
 +    * ''{doc.filename} - {artboard.name}.pdf'' 
 +    * ''{doc.filename} - {artboard.name} - {doc.colorSpace} - [{pdf.preset}] - {artboard.number} of {artboard.count}.pdf'' 
 +    * ''{doc.filename} - PROOF Ver{?Proof Version}.pdf'' (asks for the version number) 
 +    * ''Archive of {doc.filename} - [{weekday} {day}-{month}-{year}].pdf'' 
 + 
 +^ Code ^ What it gives ^ Example ^ 
 +| ''{timestamp}'' | Date and time | 2026-02-03 14:33:12 | 
 +| ''{time}'' | Time | 14:33:12 | 
 +| ''{weekday}'', ''{shortweekday}'' | Day of the week | Monday, Mon | 
 +| ''{day}'', ''{month}'', ''{year}'' | The date | 3, 7, 2026 | 
 +| ''{linked.filename}'' | The file name of the first placed (linked) file | empty if none | 
 +| ''{pdf.preset}'' | The PDF preset's name | | 
 +| ''{artboard.width}'', ''{artboard.height}'' | The artboard's size in document units | | 
 +| ''{artboard.number}'', ''{artboard.count}'' | The artboard's number, and how many there are | | 
 +| ''{artboard.name}'' | The (first) artboard's name | | 
 +| ''{export.number}'', ''{export.count}'' | The page being exported, and how many | | 
 +| ''{doc.rulerunits}'' | The ruler units | mm | 
 +| ''{doc.colorSpace}'' | The colour mode (catches export mistakes later) | RGB | 
 +| ''{doc.filename}'' | The document's file name | example.ai | 
 +| ''{?Question}'' | Asks you, and uses your answer | ''{?Customer Name}'' asks "Customer Name" |
  
 +=== History ===
  
-</sxh>+  * **Save the last ... exported items**: keep a list of the PDFs you've exported. Double click one to open it. 
 +  * **Copy Filenames**, **Copy Full Filenames** (with the folder), **Select All**, **Select None**, **Clear**.
  
-==== Filename ====+  * **Export PDF ...**: does it.
  
-You can setup the filename template, and the values in the template will be replaced as the PDF file is exported.+==== Conf Strip ====
  
-  * {doc.filename} - {artboard.name}.pdf +{{:pdf_export:conf_strip_tab.png?380|The Conf Strip tab}}
-  * {doc.filename} - {artboard.name} - {doc.colorSpace} - [{pdf.preset}] - {artboard.number} of {artboard.count}.pdf +
-  * {doc.filename} - {artboard.name} - {artboard.number} of {artboard.count}.pdf +
-  * {doc.filename} - PROOF Ver{?Proof Version}.pdf **(This will ask for the version number)** +
-  * {doc.filename} - PAGE  {artboard.number} -  {artboard.width}x{artboard.height} {doc.rulerunits}.pdf +
-  * {doc.filename} - {export.number} of {export.count} PROOF.pdf +
-  * * Archive of {doc.filename} - [{weekday} {day}-{month}-{year}].pdf+
  
-|**{Variable}**|**Description**|**Example Output*| +  * **Min Artboard Size for Confidance Strips**: only add strips to artboards at least this big. 
-|timestamp|Timestamp| 2024-02-03 14:33:12| +  * **Strip Width**, **Strip Padding**: the size of the strip and its gap from the artwork.
-|time|Time HH:MM:SS|14:33:12| +
-|weekday|Weekday|Monday| +
-|shortweekday|Short Weekday|Mon| +
-|day|Day|3| +
-|month|Month|7| +
-|year|Year|2024| +
-|linked.filename|Filename of First Linked File|*Empty if none found| +
-|pdf.preset|PDF Preset Name| | +
-|artboard.width|Artboard Width in document units | | +
-|artboard.height|Artboard Height in document units| | +
-|artboard.number|Artboard Page Number|  | +
-|artboard.name|The first Artboard Name in the range|  | +
-|artboard.count|Total Artboard Count| | +
-|export.number|Current count of pages being exported| | +
-|export.count|Total Number of pages being exported|  | +
-|doc.rulerunits|Ruler Units|mm| +
-|doc.colorSpace|Document Color Space|RGB| +
-|doc.filename|Document filename|example.ai| +
-|?Question|Uses the text to ask a question| {?Customer Name} will prompt for "Customer Name"|+
  
-==== History ==== +==== Settings ====
-The script will save the last 100 items exported to a history list, you can view the exported files, copy the filename or full filename with paths, and open the file (double click on the filename) or open the folder+
  
-==== Release Notes ====+  * **Secure PDF Password**: the password for **Secure with password**.
  
-===== 2.3.3 ===== +===== Tips =====
-  * Added a Javascript option to allow changing of the path and filename for more automated workflows; for example, use the filename to set the correct path to save to. +
-  * Allowed Subfolder creation in filename template. +
-  * Added History to record exported files and reopen them.+
  
-===== 2.1.0 ===== +  * Save a preset for each kind of PDF you make (see [[using_presets|Using Presets]]), for example "Proof, low res, secured" and "Print, PDF/X-4, separate files". 
-  * Added option to check spelling before creating PDF+  * Put ''{doc.colorSpace}'' in proof names: an RGB file going to a CMYK press stands out straight away. 
 +  * Run an export from a key with [[hotkeys|Hotkeys and Quick Keys]].
  
 +===== What's new =====
  
-===== 2.0.2 ===== +  * **2.3.7** 
-  * Fixed issue where UI was crashing +    * Fixed: the JavaScript filename code is used for the exported files, not only by Test. 
-  +    * Fixed: "Artboards with Selected Artwork" also finds artwork that starts off the artboard. 
-===== 2.0.1 ===== +    * Improved: general bug fixes, reliability and speed. 
-  * Requires PowerScripts 3.4.2 +  * **2.3.6**: Updated for PowerScripts 3.8.32. 
-  * CC2018 Compatability Fixes+  * **2.3.5**: Updated for the new version of PowerScripts. 
 +  * Older changes: [[releasenotes|PowerScripts Release Notes]]
  
-===== 2.0.0 ===== 
-  * Export artboards as separate files (NEW in 2.0.) 
-  * Secure the PDF with just a click using a common password 
-  * Add printers confidence strips for large format printers 
-  * Export just the currently selected artboard, a range of pages or the entire document 
-  * Automatically name the PDF, including adding:  (NEW in 2.0.0) 
-    * Custom text 
-    * Timestamp, weekday name, day, month, year 
-    * The Linked filename of a placed document 
-    * Artboard size or name 
-    * Artboard number 
-    * Total number of Artboards 
-    * Exported page count 
-    * Document color mode (Helps to capture export errors downstream) 
-    * Document filename 
-    * Add in custom values which will ask for user input, such as a revision number 
-  * Set a destination to save  (NEW in 2.0.0) 
-    * Last Exported to Folder 
-    * Documents Folder 
-    * Fixed Location 
-    * Current document working folder 
-    * Sub folder - creating it if it does not exist 
-  * Prompt for filenames or save each file without asking 
-  * Open the destination folder after exporting  (NEW in 2.0.0) 
-  * Set different defaults to use for quick reuse 
pdf_export.txt · Last modified: by remoteuser