SaveToPDFTool
Tool |
With the Save to PDF tool, you can save reports and spreadsheets in a pdf format.
Save to PDF:
- Go to File>Save to PDF in the toolbar.
- Select the reports and spreadsheets you wish to save.
- Click OK.
- Choose the name and location for the PDF file.
- Click Save.
Notes:
- Some things will not appear in the PDF, like expression highlighting and spreadsheet cell borders.
Automating PDF generation
Within a macro, you can automate PDF generation by calling the Save to PDF tool as a function, such as in this example:
Library.Tools.File.SaveToPDFTool({ Frames: [ Report1 ], Path: "~/Desktop/output.pdf" })
Note that the ~/ in the path refers to the user folder. You can output to any path available to the application. On Windows computers, you can use either forward slashes or backward slashes, but remember that within a string literal, you must use \\ instead of \ for each backward slash. You can assemble dynamic paths with string concatenation with the + operator.
You can output a single frame, as in the example above. You can also output multiple frames, and you can specify page ranges, as in this example:
Library.Tools.File.SaveToPDFTool({ Frames: [ { Frame: Report1, Pages: "1" }, { Frame: Report2, Pages: "1-3,9" } ], Path: "~/Desktop/output.pdf" })
When automating this tool, the PDF will not be opened after saving as otherwise is with this tool. However, you can make it open by setting the OpenAfter parameter as in this example:
Library.Tools.File.SaveToPDFTool({ Frames: [ Report1 ], Path: "~/Desktop/output.pdf", OpenAfter: true })
If your macro depends on updating formulas before saving to PDF, remember to call
Document.Recalculate();before saving the PDF.
See also:
You can refer to this tool in any formula, macro, module, or other script in Blockpad. You can use either its name or its full path:
-
To refer to it by name, use
SaveToPDFTool
(make sure the library Library.Tools.File is included with Include Libaries) - To refer to it by its full path, use
Library.Tools.File.SaveToPDFTool
See also: