Hello,

Im wanting to write a basic VB application that will allow the user to select a bunch of PDF files then print them in bulk. I have achieved something similar with Microsoft Excel, using the shell command to do this. (ie, VB app allowing users to select a bunch of .xls files and batch them to print in Excel using a shell)

Furthermore, it woul dbe nice to be able to pass in parameters to specify the papersize, orientation etc. is that at all possible?

Is there something similar to the shell command for Adobe Acrobat?

Thanks,

Jac

You can add an Acrobat Control Component to your form. One of the functions of the control will be to print a PDF document. You probably need to do some investigation on how to use the control. But you can go to Adobe's website. They do have an SDK you can download and use with VB6 along with documentation and examples on how to use the components they give you.

Hello,

So i have a way around it, im using the shellexecute, as seen by the following:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute Me.hwnd, "print", "c:\etc.pdf", vbNullString, vbNullString, SW_SHOW

My next question is, can i specify printing parameters when using this? im particulary interested to specify the paper orientation and paper size?

Thanks,

Jac

Read the MSDN Documentation. It has the answers.

The properties of the Printer object initially match those of the default printer set in the Windows Control Panel. At run time, you can set any of the Printer object properties, which include: PaperSize, Height, Width, Orientation, ColorMode, Duplex, TrackDefault, Zoom, DriverName, DeviceName, Port, Copies, PaperBin, and PrintQuality. For more details and syntax for these methods, see the Language Reference(MSDN).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.