The Adobe AxAcroPDF control has no function to return the current page number. I'm just making a personal utility, so I had the luxury of settling on a hack method I thought I would share... It's patched together with bits and pieces from across the net. It uses Windows native functions from User32.dll to enumerate the children of the control and find the textbox in the toolbar that corresponds with page number. The text from that is then read using a SendMessage call.
Determine Current page in AxAcroPDF object in C#
1.5k views Asked by TomEverin At
1
There are 1 answers
Related Questions in WINFORMS
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- TCP Client Losing Connection When Writing Data
- how check if printing content on new page
- Find what is writing to the Output window
- WinForms, event unable to subscribe from a custom class
- A cleaner way to approach the given output
- Working with panel and moving from the second form to the the panel
- Accurately placing multiple controls in a row programmatically with dynamic table layout panel
- How to find winform application in visual studio 2022?
- How to stop comments being included in C# release build .exe
- Why is the Blazor value not immediately being rendered after changing it?
- .NET 6 Winforms separate forms control pop up freezing when unfocused and using native Windows file transfer pop up
- How to Fix C# WinForms Application Not Loading correctly on Windows 11?
- Visual Studio edit view corrupt for xaml and Winforms design views
- How to solve the problem that dragged column in datagridview too slow or miss when AllowUserToOrderColumns = true
Related Questions in PDF
- How to use custom font during html to pdf conversion?
- How to get content of BLOCK types LAYOUT_TITLE, LAYOUT_SECTION_HEADER and LAYOUT_xx in Textract
- PDF form checkbox/radio button ignores content stream
- Suggest python library for rendering html to pdf files
- Problems with the order in which PDF files are created
- Centering a map element on a generated PDF
- download all pdf files from website doesn't support wildcard
- How to enter external pdf into quarto book while keeping page layout+numbering
- How do I create a website that combines user input and standard text and converts it into a pdf?
- Excel VBA error 1004 on PDF export - not a path issue
- downloading pdf using requests not working
- Creating pdf on Firestore with Pdfplum: Template path "no such object"
- Export password protected PDF from QGIS
- XPS convert PDF with Ghostscript
- Download PDF in ASP.NET MVC application
Related Questions in AXACROPDF
- File being used by another process when using File.CopyTo method
- PDF display and URL redirection from WPF application
- how to automate xacro property extraction from .xacro file and use it in a python script in ROS
- C# Open a pdf from url in windows form
- AxAcroPDF won't open hyperlinks
- Is there a way to suppress adobe PDF reader API (AxAcroPDF) info messages?
- Hide "Export PDF, Create PDF, etc" Pane and Keep It Hidden
- AxAcroPdf Showing side bar
- Embbed a PDF into a WPF WebBrowser and then print it
- Clear and Reload PDF with axAcroPDF
- Loading file on axacropdf (pdf component) from mixed listbox
- WPF Control Freeze after WindowsFormsHost trigger to view PDF
- Unable to open network PDF file from embedded link inside another PDF
- Determine Current page in AxAcroPDF object in C#
- Show a Label while AxAcroPDF is still rendering or loading a file
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
This method enumerates the children components of the adobe pdf viewer and finds the text boxes in the toolbar. One of the textboxes is the page number, one is the current zoom value. The text box without a '%' in its content is taken as the page number text box. The content of the text box is retrieved using the SendMessage function.
You might need to call SetToolbarVisible(true) on the viewer component first, to make sure the toolbar (and hence text boxes) are visible.
This is a terrible and hacky solution, and could easily break as Adobe update the viewer. It would be great if Adobe would add a "getCurrentPage" method so all of this could be avoided.