Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Automate Printing in Adobe Exchange

Keywords:     Automate Printing in Adobe   print a PDF file 

Print a PDF file:
pdf_file = "C:\Temp\Test.pdf"

adobe = objectopen("AcroExch.app") ; create an application object
pddoc = ObjectOpen("AcroExch.pddoc") ; create an application object
printdoc = ObjectOpen("AcroExch.avdoc") ; create an application object

pddoc.open(pdf_file)
printdoc.open(pdf_file, "")

numpages = pddoc.GetNumPages() ; Page count
Message("Number of pages", numpages)

avdoc = adobe.getActiveDoc
avdoc.PrintPages(0,numpages,1,0,0)
pddoc.close
adobe.CloseAllDocs()
adobe.exit ; exit the application

objectclose(pddoc) ; close the application object
objectclose(adobe) ; close the application object
objectclose(printdoc) ; close the application object 


Article ID:   W15250