PrintPaperOptions
PrintPaperOptions
Section titled “PrintPaperOptions”new PrintPaperOptions()
Description
Section titled “Description”Information about the paper to be used in the print job.
Properties
Section titled “Properties”PrintPaperOptions.height
Section titled “PrintPaperOptions.height”printPaperOptions.height
Description
Section titled “Description”The custom height (in points) for using the custom paper.
Default: 0.0
Number (double)
PrintPaperOptions.name
Section titled “PrintPaperOptions.name”printPaperOptions.name
Description
Section titled “Description”The paper’s name.
String
PrintPaperOptions.offset
Section titled “PrintPaperOptions.offset”printPaperOptions.offset
Description
Section titled “Description”Custom offset (in points) for using the custom paper.
Default: 0.0
Number (double)
PrintPaperOptions.transverse
Section titled “PrintPaperOptions.transverse”printPaperOptions.transverse
Description
Section titled “Description”If true
, transverse the artwork (rotate 90 degrees) on the custom paper.
Default: false
Boolean
PrintPaperOptions.typename
Section titled “PrintPaperOptions.typename”printPaperOptions.typename
Description
Section titled “Description”The class name of the object.
String; read-only.
PrintPaperOptions.width
Section titled “PrintPaperOptions.width”printPaperOptions.width
Description
Section titled “Description”The custom width (in points) for using the custom paper.
Default: 0.0
Number (double)
Example
Section titled “Example”Setting print paper options
Section titled “Setting print paper options”// Creates a new document, adds a path item, applies a graphic style// then prints with specified paper optionsvar docRef = documents.add();var pathRef = docRef.pathItems.rectangle(600, 200, 200, 200);docRef.graphicStyles[1].applyTo(pathRef);
var paperOpts = new PrintPaperOptions;var printOpts = new PrintOptions;printOpts.paperOptions = paperOpts;
var printerCount = printerList.length;if (printerCount > 0) {
// Print with the 1st paper from the 1st printer for (var i = 0; i < printerList.length; i++) {
if (printerList[i].printerInfo.paperSizes.length > 0) { var printerRef = printerList[i]; }
var paperRef = printerRef.printerInfo.paperSizes[0]; if (printerRef.printerInfo.paperSizes.length > 0){ paperOpts.name = paperRef.name; printOpts.printerName = printerRef.name; docRef.print(printOpts); } }}