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

VBA PrintPagesSilent parameters

New Here ,
Jan 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

Good morning,

I need to modify a macro in VBA so that it prints pages 2 to the end of a PDF document.

The problem is how to specify the last page of the document, which varies with every document the macro has to process.

Can you please explain how to do it? Maybe it requires getting the lenght of the PDF document first, which I don't know exactly how to do it.

This is the macro code so far, which would only print from page 2 (first parameter) up to page 3 (second parameter):

                ad_ac_doc.Open ("DocName.pdf"), ""

                pri_err = ad_ac_doc.PrintPagesSilent(1, 2, 2, 0, 0)

                ad_ac_doc.Close 1

                ad_pd_doc.Close

                Set ad_pd_doc = Nothing

                Set ad_ac_doc = Nothing

                Set ad_app = Nothing

Thanks and best regards.

TOPICS
Acrobat SDK and JavaScript

Views

1.2K

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 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

LATEST

Hi,

Could you not just call GetPDDoc and then use the GetNumPages call?

Something like ( just of the top of my head, so not tested.)

ad_pd_doc = ad_ac_doc.GetPDDoc();

// because PDF docs start at page 0.

numPages = ad_pd_doc.GetNumPages() - 1

pri_err = ad_ac_doc(PrintPageSilent ( 1, numPages, 2, 0, 0)

hope this helps

Malcolm

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