Skip to main content
Participant
January 24, 2018
Question

Print from PDF and change Paper Size

  • January 24, 2018
  • 2 replies
  • 2174 views

Dears,

I have the challenge that I need to print an PDF in Format A5. Want to do this with VBA.

The AVDoc /PDDoc matter can bee out of scope here, not finally decided who I will feed the PDF in.

The Challenge is:

Print PDF on Standard Printer, Format A5. The default Format is A4.

I am already searched here and the whole SDK, from this I was able to Build up something. But this is not workung fine and my main Issue is not fixed here.

Dim AcroApp As Acrobat.CAcroApp

Dim PdDoc As Acrobat.CAcroPDDoc

Set AcroApp = CreateObject("AcroExch.App")

Set PdDoc = CreateObject("AcroExch.PDDoc")

Dim AcroPDDoc As Acrobat.AcroPDDoc

Dim JSObject As Object

Dim pp As Object

Dim fv As Object

If PdDoc.Open("C:\Users\ND01132\Downloads\Loadlist (6).pdf") = True Then

Set JSObject = PdDoc.GetJSObject

Set pp = JSObject.getPrintParams

pp.Interactive = AcroPrintParams.Constants.interactionLevel.Silent

pp.firstPage = 0

pp.lastPage = 1

pp.pageHandling = 1

Set fv = pp.Constants.flagValues

pp.flags = fv.setPageSize()

JSObject.Print (pp)

End If

For the Line pp.Interactive = AcroPrintParams.Constants.interactionLevel.Silent I always get the Runtime Error 424 - Object Required. Not Sure how to fix This.

Next Point is fv.setPageSize() How can I change the Papersize to A5 ?

Happy to hear some Tips !

Regards

Yannick

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
January 26, 2018

You can't specify a pagesize there. Use the property pageHandling.

lrosenth
Adobe Employee
Adobe Employee
January 24, 2018

The printParams are the correct thing to use. You are using Adobe Acrobat Pro and not simply Acrobat Reader, correct?

Participant
January 25, 2018

Dear,

thats sounds good at all.

Yes, Acrobat Pro