Publish to PDF
Contents
- OutputJob Editor
- Adding New Outputs
- Adding Output Media
- Assigning Outputs to the Output Medium
- Publishing your Outputs
- Publish to PDF
- Configuring PDF Medium
- Output File Path
- Zoom
- Additional Bookmarks
- Page Size and Orientation
- Publishing to PDF
- Browsing the Generated PDF
- How to Publish to PDF using the PublishToPDF Script
- How to Customize the Script
- Sample Script – Publish to a PDF using the specific PDF Output Medium
Publish to PDF allows you to publish PDF documents from the OutputJob Editor. Any number of outputs including Schematic, OpenBus, PCB, PCB3D, BOM and Assembly Drawings can be collated into PDFs using the Output Generators in the Output Job Editor.
OutputJob Editor
The process of setting up outputs for your design and publishing them is performed in the OutputJob Editor. The OutputJob Editor allows you to define and manage Output Job Configuration files (*.Outjob) for the current Design Project.
An OutJob file consists of two parts:
Outputs - Assembly Outputs, Documentation Outputs, Fabrication Outputs, Netlist Outputs and Report Outputs
Output Media – choose to publish your Outputs from a variety of Output Media including PDF, direct printing and file generation.
You can create a number of Output Media with differing outputs to meet your publishing needs. You can also give your Output Media a custom name to differentiate between them. The green arrows in Figure 2 represent the linking of Outputs to an Output Medium.
Adding New Outputs
When you create a new Output Job file, only the relevant outputs for your project are added to the file and configured using default setups. New outputs can be added to the file by either:
- Using the relevant Edit » Add Outputs menu items to choose the required output
- Clicking on the relevant Add New entry under each category and choosing the required output from the pop-up menu that appears.
Adding Output Media
The Output Media column can contain a list of Publish to PDF, Print and File Generation publishing media.
Add a new Output Medium in the Output Media column by either:
- Clicking on the [Add New Output Medium] field and choosing one a publishing medium from the pop up menu that appears
- Dragging and dropping outputs from the Outputs section on the Output Media column
- Copying and pasting outputs from the Outputs section onto the Output Media column
To customize the name of your Output Medium, click once the Output Medium to focus it and click again or press F2 , change the name to a meaningful name for your project.
Assigning Outputs to the Output Medium
The availability of outputs is dependent on the type of publishing medium chosen from the Output Media column. Not all outputs can be published to PDF or generated as a file. This is indicated by the state of the Enabled field.
By assigning outputs to a given publishing medium, you are defining the contents of the publication. Green lines show which outputs have been selected for which output medium.
As you enable your outputs, they are numbered consecutively. If you remove one of the outputs from your Output Medium, the numbers are re-ordered accordingly. To change the order of your enabled outputs, double click on the number and select a number from the drop-down or alternatively, re-select each output in order.
Publishing your Outputs
Publish the selected Output Medium by clicking on the button at the top of the Output Media column or by pressing the F9 short cut key.
For more detailed information on adding or editing Outputs and Output Media in an OutJob File, see Design to Manufacturing.
Publish to PDF
The availability of Output Jobs is specific to the Output Medium selected. For a Publish to PDF Medium, the Outputs that can be linked to this PDF Medium have their Enabled field visible
The types of Outputs that can be assigned to a PDF Output Medium include:
- Assembly Drawings including the ability to customize based on Assembly Variants
- Schematic Prints - Project Physical Prints (including the ability to customize based on Assembly Variants)
- Schematic Documents – Logical Prints or selected prints
- PCB Prints
- PCB 3D Prints
- OpenBus Prints
- Logic Analyzer Prints
- SimView Prints
- Wave Prints
- WaveSim Prints
- Composite Drawing
- Drill Drawing/Guides
- Final Artwork Prints
- Power Plane Prints
- Solder/Paste Mask Prints
- Composite Drill Drawing
- Bill of Materials including the ability to customize based on Assembly Variants
Once the Outputs have been configured and assigned to a Publish to PDF medium, you can configure the Publish to PDF settings prior to publishing.
Configuring PDF Medium
The PDF Setup configures the PDF Output Medium prior to publishing.
Configure PDF settings by right clicking on the PDF Output Medium and choosing PDF Setup from the pop up menu that appears.
The Publish to PDF Settings dialog is categorized into four different groups:
Output File Path
Use this field to specify the Output File Path and filename for your PDF. You can browse to locate your preferred Output File Path. By default, PDFs will be saved to the output path specified in the Options tab of your Project Options ( *Project » Project Options* ).
Additional Output Settings
- Open PDF file after export – enable the checkbox to open your published PDF after it has been generated.
- Prompt if file already exists – enable the checkbox to prompt you to overwrite an existing PDF file.
- Generate a separate PDF file for each output – enable the checkbox to create one PDF for each of the selected outputs and also to use the Name of each output as the PDF Filename.
You can customize the filename and specify a folder for your PDFs, using the Name field in your OutJob file. Use the format FOLDER\FILENAME, giving you greater control over the filename, and location of your generated PDFs.
For example you can replace the Schematic Prints name with Sch\Schematic Prints and PCB Prints name with PCB\PCB Prints as shown in Figure 5. The PDFs for the Schematic Print and the PCB Prints will be generated in the Schematic and PCB folders respectively when the Generate a separate PDF file for each output option is enabled.
Zoom
Use the zoom slider bar to specify the zoom level used in the PDF Viewer when browsing components, nets and ports.
Additional Bookmarks
Use Additional Bookmarks to control whether net information is generated in the PDF or not. If the Generate nets information checkbox is enabled, additional bookmarks can be created for nets: Pins, Net Labels and Ports . Bookmarks for enabled objects (Pins, Net Labels and/or Ports) will be created in your PDF.
Page Size and Orientation
The Page Size and Orientation settings controls whether the page size and orientation are derived from either the Page Setup Dialog or from the Source Document for both Schematic Pages and PCB Pages.
Page Size and Orientation can be configured for each Schematic Sheets by either:
- Using the Design » Document Options command from the Schematic Editor (choose Source Document for these settings to be implemented in your PDF)
- Using File » Page Setup command from the Schematic Editor (choose Page Setup Dialog for these settings to be implemented in your PDF)
- Right-clicking on the selected output in the OutputJob Editor and choosing Page Setup command from the pop-up menu that appears (choose Page Setup Dialog for these settings to be implemented in your PDF)
Page Size can be configured for PCB Designs by:
- Using the Design » Board Options command from the PCB Editor (choose Source Document for these settings to be implemented in your PDF)
- Creating a new PCB design from a template with a pre-defined page size (choose Source Document for these settings to be implemented in your PDF)
Page Size and Orientation can be configured for PCB Designs by either:
- Using File » Page Setup command from the PCB Editor (choose Page Setup for these settings to be implemented in your PDF)
- Right-clicking on the selected output in the OutputJob Editor and choosing Page Setup command from the pop-up menu that appears (choose Page Setup for these settings to be implemented in your PDF)
Publishing to PDF
To publish your selected PDF Output Medium with the configured options, you can either:
- Click the button which has the selected Output Medium name with the PDF icon in the Output Media column.
- Right click and select the Publish to PDF option from the popup on the Output Media column.
- Press keyboard short cut F9
- Select Publish to PDF command ( Tools » Publish to PDF )
Browsing the Generated PDF
To view your generated PDF, enable the Open PDF file after export checkbox from the Publish to PDF Settings dialog or navigate to your output file path and open your PDF.
The generated PDF document is a grouping of all of your selected outputs. Bookmarks are provided to enable you to navigate through your document and these are based on your Additional Bookmarks settings. If the source schematics are hierarchical, the hierarchy is reflected in the PDF Bookmarks.
Clicking on a component, net, pin, port or net label bookmark will zoom to and highlight the area where the object resides.The level of zoom applied is determined by the zoom set in the Publish to PDF Settings dialog. Highlighting is applied when browsing by component, net, pin, port or net label bookmark for ease of reference.
Publish to PDF using a Script
To automate the publication of Output Jobs, you can write a script to bypass the Publish to PDF Settings dialog and generate a PDF document quickly and easily. The PublishToPDFScript script as part of the Altium Designer installation is provided here to demonstrate how a PDF publishing job can be executed from an open OutJob file.
The script project containing the PublishToPDFScript script is provided from the \Examples\Scripts\Delphiscript Scripts\Processes\Process_Scripts.PrjScr folder of the Altium Designer installation.
How to Publish to PDF using the PublishToPDF Script
To Publish to PDF using the supplied PublishToPDFScript script, you must load or create an OutJob file with a Publish to PDF medium.
Irrespective of which Output medium is set in the OutJob file, when you execute the PublishToPDF_AssemblyDrawingsAndSchematicPrints procedure from this script, a PDF file is generated for the existing Assembly Drawings and Schematic Prints Outputs.
To publish a PDF from the OutJob File with existing Assembly Drawings and Schematic Prints;
- Load your design project which contains an OutJob file defining some Assembly Drawings and Schematic Prints. For example the Default Assembly Outputs.OutJob for the Mixer project from the \Examples\Reference Designs\ Multi-Channel Mixer folder can be opened in Altium Designer
- Load the Process_Scripts.PrjScr that contains the PublishToPDFScript script from the \Examples\Scripts\Delphiscript Scripts\Processes\Process_Scripts.PrjScr folder
- Select the DXP » Run Script command which brings up the Select Item To Run dialog. The Process_Scripts project will be displayed in this dialog
- Select the PublishToPDF_AssemblyDrawingsAndSchematicPrints procedure under the PublishToPDFScript.pas script entry and click OK .
The PDF file with the Assembly Drawing and the Schematic Prints Outputs is published automatically by the script on the Default Assembly Ouputs.OutJob file. This AssemblyAndSchematic.PDF file is generated in the C:\ folder. You can have a look at the script by opening the PublishToPDFScript.pas file in Altium Designer.
How to Customize the Script
The possible parameters and values for the Workspacemanager: Print process that are required to publish to a PDF from a script are outlined in the table below.
Parameter Name | Value | Default | Description | Needed |
---|---|---|---|---|
Action | String | PublishToPDF | If Action is set to PublishToPDF then you can use the other parameters in this table to customize the generation of your PDF document. | Yes |
ObjectKind | OutputSelected / OutputBatch | OutputSelected | If ObjectKind set to OutputSelected then you need to specify the SelectedNameX parameters which represent the Outputs (the highlighted blue cells of Outputs on the OutJob file). If ObjectKind is set to OutputBatch then the enabled Outputs (with green arrows on the OutJob file) can be generated. | No |
SelectedNameX | String |
| Where X is a number. SelectedNameX corresponds to the existing Output in the Name field of the OutJob file irrespective of the selected Output Medium in the Output Media column. The ObjectKind parameter needs to be set to OutputSelected as well.For example if you wish to generate the Assembly Drawings and Schematic Prints Outputs then you specify AddStringParameter('SelectedName1', 'Assembly Drawings') and AddStringParameter('SelectedName2', 'Schematic Prints') in a script. | No |
DisableDialog | True / False | False | If the parameter is set to True | No |
OpenOutput | True / False | * | If the parameter is set to True, | No |
ZoomLevel | Integer | * | The value can be set between 1 (far) and 100 (near). If the value is less than 1, it will default back to 1, if the value is greater than 100, it will default back to 100. The ZoomLevel parameter | No |
FitSchPrintSizeToDoc | True / False | * | This parameter overrides the | No |
FitPCBPrintSizeToDoc | True / False | * | This parameter overrides to the | No |
GenerateNetsInfo | True / False | * | This parameter overrides the | No |
MarkPins | True / False | * | This parameter overrides the Pins bookmark control on the Publish To PDF Settings dialog. Defaults to True. | No |
MarkNetLabels | True / False | * | This parameter overrides the Net Labels bookmark control on the Publish To PDF Settings dialog. The GenerateNetsInfo | No |
MarkPorts | True / False | * | This parameter overrides to the Ports bookmark control on the Publish To PDF Settings dialog. The GenerateNetsInfo | No |
OutputMedium | String |
| This parameter targets | No |
PublishMethod | 0 / 1 | * | This parameter determines whether the Outputs will be published as a Single File (PublishMethod = 0) or as Multiple Files (PublishMethod = 1). This parameter overrides the Generate a separate PDF file for each output control on the Publish To PDF Settings dialog. You will also need to specify the OutputFilepath parameter. | No |
OutputFilepath | String | The path of the OutJob file with a PDF extension | If the PublishMethod = 0 then the OutputFilepath should be a full path and file name. | No |
Notes:
1. The asterisks, *, in the *Default* column of the table correspond to the default settings of the Publish to PDF settings dialog.
2. The default values of the Publish to PDF Settings dialog are extracted from each Output Medium in the OutJob File. Every time you configure the Output Medium and save the OutJob file, the new settings for this Output Medium are saved in this OutJob file.
Sample Script – Publish to a PDF using the specific PDF Output Medium
A sample script has been provided below to publish all enabled Outputs to a PDF. You will need an OutJob file that has a PDF Output Medium with the DocoPDF name before running the script on it.
To define the contents of the published PDF file, the default settings are used from the DocoPDF Output Medium. You can either use the Publish to PDF Settings dialog to change the settings or use the available parameters from the table above in the script to override the settings for this Publish to PDF Settings dialog.
Procedure PublishToPDF_DocoPDF_Medium; Begin ResetParameters; AddStringParameter ('Action', 'PublishToPDF'); // Select an existing PDF Output Medium. If not found, first PDF Medium will be used. AddStringParameter ( 'OutputMedium' , 'DocoPDF'); // Publish all the selected Output Jobs AddStringParameter ( 'ObjectKind' , 'OutputBatch'); // Don't display the Publish to PDF Settings dialog AddStringParameter ( 'DisableDialog' , 'True'); //Publish selected Output Jobs in a single PDF file AddIntegerParameter( 'PublishMethod' , 0); // Override the Output File path setting in the Publish to PDF Settings dialog AddStringParameter ( 'OutputFilePath' , 'C:\Doco.pdf'); RunProcess('WorkspaceManager: Print'); End ;
This script contains the Workspacemanager: Print process with various AddStringParameter and AddIntegerParameter calls to generate a DocoPDF.PDF file in the C:\ folder.
You can add this script in the PublishToPDFScript.pas file from the Process_Scripts.PrjScr project and run the PublishToPDF_DocoPDF_Medium procedure from the Select Item To Run dialog in the OutJob Editor.
Refer to the Altium Designer Scripting documentation for an introduction to Scripting, and information on building script projects.
Refer to the Customizing the Altium Designer Resources tutorial for details on how to create new shortcuts or update resources in Altium Designer.
To learn more about the practical benefits of scripts in Altium Designer, study the script examples in the downloadable Script Example collection.