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

PDF Reader control (Windows, C#) - How to get current page number?

Engaged ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

I built a six-panel PDF display app, with 6 instances of the PDF Reader COM control on a Windows Form, and everything works great.

When the program loads, it reads a settings file to open the last set of PDF files so the user can continue where he left off.

 

I use SetCurrentPage so the user can specify what page to start each PDF on. But when the app exits, I need to SAVE the new current page so the user doesn't have to do this manually.

 

In order to restore the last page in each PDF, I have to find out the current page of the PDF Reader controls.

 

The control exposes a .setCurrentPage method, but nothing to GET the current page number. The exposed methods and properties don't seem to provide any access to the current page number.

 

Is there a way to do this?

 

Two DLL's are resident in the project: AxInterop.AcroPDFLib.dll and Interop.AcroPDFLib.dll, if that's relevant.

 

Thanks in advance,

Allen

 

TOPICS
Windows

Views

656

Likes

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 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

There is no method in the control for this.

Likes

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
Engaged ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Ouch. That's a major disappointment. Do you have any suggestions for a slightly more useful way to instantiate a PDF reader inside a Win desktop C# app?

Thanks.

Likes

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 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Get the AVPageView from the AVDoc, then use AVPageView.GetPage();

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

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
Engaged ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Thanks, Thom,

Is this a COM object? I'm not sure how to include it in the VS IDE for C#.

Also, will there be an instance of AVPageView in every instance of the Reader control?

BTW, this is for internal noncommercial use (and I have a full CC license).

 

I've taken a look at the AVPageView online docs, but I haven't yet seen how to incorporate it into my project.

 

Likes

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 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

Yes it is a COM object,or rather a COM interface. I may have been mistaken to have suggested it.  This part of the AcroExch API is only available through Acrobat Professional. It's not in Reader 😞  

 

Please see the reference for clarification:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%...

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

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
Engaged ,
Jan 31, 2022 Jan 31, 2022

Copy link to clipboard

Copied

I'll look into it further. Since I have CC, I have Acrobat Pro DC, and this project is for internal use only.

Thanks again for looking into this. I look forward to checking out those SDK docs.

 

Likes

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
Engaged ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

Hi Thom,

I've built a working utility EXE developed in C# (VS), and the PDF control works only when I'm signed into my paid full-CC account. If I sign into Adobe with a non-paid subscriber account, it won't display any files. Is this correct, or am I missing something that would permit it to operate with only Adobe Reader installed and a non-paying Adobe account? I've set the default PDF app to the Reader, and not AcrobatCC, and signed into Adobe as the non-paid subscriber.

 

Thanks in advance,

Allen

 

Likes

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 ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

For the use of the COM object you need an installation of Adobe Acrobat.

Likes

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
Engaged ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

Well, that's inconvenient!

Thanks for the info.

Likes

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
LEGEND ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

LATEST

Think of the Acrobat SDK as a marketing tool for Acrobat. There is a very tiny set of functions available in Reader, but think of them as designed to convince you of the wonders of Acrobat and persuade you to buy it. Nothing pleases Adobe better than selling copies across a company...

Likes

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