• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Print from PDF and change Paper Size

New Here ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

Dear,

thats sounds good at all.

Yes, Acrobat Pro

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2018 Jan 26, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines