WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printing Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Printing PDF Files using OLE

Keywords: 	 printing PDF files

Question:

Does anyone have an example of how to print a PDF file using Winbatch?

Answer:

Working code!
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:   W15678
File Created: 2003:05:13:11:29:28
Last Updated: 2003:05:13:11:29:28