Adobe 27510753 Scripting Guide - Page 173
Printing a document, Printing using ranges, Range, PrintPreferences
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 173 highlights
Adobe InDesign CS2 Scripting Guide Working with Documents in VBScript 165 myBottomMargin + 28, myRightMargin) myRightFooter.ParentStory.InsertionPoints.Item(1).Contents = idSpecialCharacters. idAutoPageNumber myRightFooter.ParentStory.InsertionPoints.Item(1).Contents = idSpecialCharacters.idEmSpace myRightFooter.ParentStory.InsertionPoints.Item(1).Contents = idSpecialCharacters. idSectionMarker myRightFooter.ParentStory.Characters.Item(-1).AppliedCharacterStyle = myDocument. CharacterStyles.Item("page_number") myRightFooter.ParentStory.Paragraphs.Item(1).ApplyStyle myDocument.ParagraphStyles. Item("footer_right"), False Rem Slug information. Set myRightSlug = .TextFrames.Add myRightSlug.ItemLayer = myDocument.Layers.Item("Slug") myRightSlug.GeometricBounds = Array(myDocument.DocumentPreferences.PageHeight + 36, myLeftMargin, myDocument.DocumentPreferences.PageHeight + 144, myRightMargin) myRightSlug.Contents = myString myRightSlug.ParentStory.Texts.Item(1).ConvertToTable Rem Body text master text frame. Set myRightFrame = .TextFrames.Add myRightFrame.ItemLayer = myDocument.Layers.Item("BodyText") myRightFrame.GeometricBounds = Array(.MarginPreferences.Top, .MarginPreferences.Left, myBottomMargin, myRightMargin) myRightFrame.PreviousTextFrame = myLeftFrame End With End With Rem Add section marker text--this text will appear in the footer. myDocument.Sections.Item(1).Marker = "Section 1" Rem When you link the master page text frames, one of the frames Rem sometimes becomes selected. Deselect it. myInDesign.Select idNothingEnum.idNothing Printing a document The following script prints the active document using the current print preferences: Rem PrintDocument.vbs Rem An InDesign CS2 VBScript Rem Prints the active document. Set myInDesign = CreateObject("InDesign.Application.CS2") Rem The PrintOut method has two optional parameters: Rem PrintDialog--if true, display the Print dialog box Rem Using--the printer preset to use. The following line Rem prints the document using the default settings and Rem without displaying the Print dialog box. myInDesign.ActiveDocument.PrintOut False Printing using page ranges To specify a page range to print, set the PageRange property of the document's PrintPreferences object before printing: Rem PrintPageRange.vbs Rem An InDesign CS2 VBScript Rem Prints a page range from the active document. Set myInDesign = CreateObject("InDesign.Application.CS2") Rem Create an example document. Set myDocument = myInDesign.Documents.Add myDocument.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin myPageHeight = myDocument.DocumentPreferences.PageHeight myPageWidth = myDocument.DocumentPreferences.PageWidth myDocument.DocumentPreferences.PagesPerDocument = 10 Set myMasterSpread = myDocument.MasterSpreads.Item(1) Set myTextFrame = myMasterSpread.Pages.Item(1).TextFrames.Add myTextFrame.GeometricBounds = Array(0, 0, myPageHeight, myPageWidth)