Adobe 27510753 Scripting Guide - Page 174
Setting print preferences
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 174 highlights
166 Working with Documents in VBScript Adobe InDesign CS2 Scripting Guide myTextFrame.Contents = idSpecialCharacters.idAutoPageNumber myTextFrame.Paragraphs.Item(1).Justification = idJustification.idCenterAlign myTextFrame.Paragraphs.Item(1).PointSize = 72 myTextFrame.TextFramePreferences.VerticalJustification = idVerticalJustification.idCenterAlign Set myTextFrame = myMasterSpread.Pages.Item(2).TextFrames.Add myTextFrame.GeometricBounds = Array(0, 0, myPageHeight, myPageWidth) myTextFrame.Contents = idSpecialCharacters.idAutoPageNumber myTextFrame.Paragraphs.Item(1).Justification = idJustification.idCenterAlign myTextFrame.Paragraphs.Item(1).PointSize = 72 myTextFrame.TextFramePreferences.VerticalJustification = idVerticalJustification.idCenterAlign For myCounter = 1 To myDocument.Pages.Count myDocument.Pages.Item(myCounter).AppliedMaster = myDocument.MasterSpreads.Item("A-Master") Next Rem End of example document setup. Rem The page range can be either idPageRange.idAllPages or a page range string. Rem A page number entered in the page range must correspond to a page Rem name in the document (i.e., not the page index). If the page name is Rem not found, InDesign will display an error message. myInDesign.ActiveDocument.PrintPreferences.PageRange = "1-3, 6, 9" myInDesign.ActiveDocument.PrintOut False Setting print preferences The PrintPreferences object contains properties corresponding to the options in the panels of the Print dialog box. This example script shows how to set print preferences using scripting: Rem PrintPreferences.vbs Rem An InDesign CS2 VBScript Rem Sets the print preferences of the active document. Set myInDesign = CreateObject("InDesign.Application.CS2") With myInDesign.ActiveDocument.PrintPreferences Rem Properties corresponding to the controls in the General panel of the Print dialog box. Rem ActivePrinterPreset is ignored in this example--we'll set our own print preferences. Rem printer can be either a string (the name of the printer) or idPrinter.idPostscriptFile. .Printer = "AGFA-SelectSet 5000SF v2013.108" Rem If the printer property is the name of a printer, then the ppd property Rem is locked (and will return an error if you try to set it). Rem ppd = "AGFA-SelectSet5000SF" Rem If the printer property is set to Printer.postscript file, the copies Rem property is unavailable. Attempting to set it will generate an error. .Copies = 1 Rem If the printer property is set to Printer.postscript file, or if the Rem selected printer does not support collation, then the collating Rem property is unavailable. Attempting to set it will generate an error. Rem collating = false .ReverseOrder = False Rem pageRange can be either PageRange.allPages or a page range string. .PageRange = idPageRange.idAllPages .PrintSpreads = False .PrintMasterPages = False Rem If the printer property is set to Printer.postScript file, then Rem the printFile property contains the file path to the output file. Rem printFile = "/c/test.ps" .Sequence = idSequences.idAll Rem If trapping is set to either idTrapping.idApplicationBuiltIn or idTrapping.idAdobeInRIP, Rem then setting the following properties will produce an error. If (.ColorOutput = idColorOutputModes.idInRIPSeparations) Or _ (.ColorOutput = idColorOutputModes.idSeparations) Then If .Trapping = idTrapping.idOff Then .PrintBlankPages = False .PrintGuidesGrids = False .PrintNonprinting = False End If End If Rem Rem Properties corresponding to the controls in the Setup panel of the Print dialog box.