Get Current Page in a PDF in windows application - c#

I have a application where I have a pdf to show. I used AxAcroPDFLib. I can successfully show any pdf in that control. Now I want to get the current page of that pdf. There is no method like getCurrentPage in AxAcroPDFLib.
How to get that current page number. I searched it but did not find any solution for this.

You're not showing the code you currently are using, but your problem likely stems from the fact that you don't realize there is an additional layer present here. The document methods in the Adobe PDF library truly only deal with the PDF file itself and a PDF file doesn't have a current page number.
To display PDF documents, Acrobat uses an AVPageView. The AVPageView is your link for anything that concerns the display of your PDF files.
AVPageView has a method to get the currently visible page:
PDPageNumber AVPageViewGetPageNum(AVPageView pageView)
So from the document, get its page view and work with that to get the page number, zoom factor, display mode and so on.

Related

Read PDF and Extract page ASP.Net

We ask the our users to print of a multi page form, fill it in, scan it and upload it to our site.
I need to be able to programmaticly find one specific page from the uploaded pdf based on a pattern that I can add (such as a Cross or a barcode) and then split the pdf to pick up that one page.
A pdf text reader won't work because, the pdf is scanned in.
Any suggestions on how to go about it would be helpful.

Multiple page document upload and display c#

I have a functionality where I need to upload a multi-page document. For display purposes, I have to give the user ability to view it page-vise. I have to show no. of pages and then user can navigate back and forth between the pages to view each page.
Any pointers on how this can be accomplished? I am using ASP.Net MVC3 and C# as the language.
Much Thanks!
If by "multi-page document" you mean like a PDF or word doc, then you'll need to embed a 3rd party viewer in your page and have it display. Generally they have the functionality you've mentioned built-in.

how to set pdf page settings to print properties dialog?

Hi all I want to know about how to set pdf page settings to print properties dialog box?
For Example,
If my PDF page settings is Landscape then Layout automatically shows Landscape not Portrait. and If my PDF page settings is Protrait then Layout automatically shows Portrait.
I have make R&D lot on this topic but not found any satisfied link. Please give me satisfied answer. this will be very helpful to me.
PDF is a device-independent format and doesn't not include functionality to set print dialog parameters. JDF was designed to compliment PDF and contain process specific settings; however, it's not supported outside of large print workflows.

Pager HTML viewer

We are currently developing a Windows Forms application in VS 2008 C#. This application is for reading long (200 - 300 pages) law documents, and it handles about 30 - 40 docs. The application searches in document text, switches between documents, etc.
Our customer has sent the docs in separate *.rtf files for us to "put it into the application". We decided to convert the rtf files into HTML, using the MS Word's "Save as" function, and then selecting "filtered HTML". In this solution, the application can show the documents in a WebBrowser control.
Our problem is: the Customer wants an additional "Pager view" function, where the user can read the documents like it would be a book. He can see the pages on a virtual paper sheet, and then click next page, previous page, etc. Like in the browser's Print preview dialog.
I have searched the internet for any Pager HTML viewer, but I haven't found anything. Could you suggest any solution or component for showing the HTML pages in pager mode?
In last case, we can hold the original rtf files too for Pager View showing. In this case, is there any solution for view RichText files in pager mode? (We want to avoid it, if it's possible.)
Waiting for your answer:
Peter
I don't know of any components that can display HTML in pages, but a couple possible solutions could be:
edit the HTML documents and manually separate them into linked pages (or hidden divs with javascript to hide/unhide divs for navigating)
convert the RTF docs to XPS format and use WPF's DocumentViewer control - but since your app is WinForms, then you'd probably have to do something like this:
http://www.codeproject.com/KB/dialog/WinFormWPFIntegration.aspx
(though someone commented on that page about a memory-leak :S that's something to keep an eye open for...)

get current page number of pdf document in asp.net

I am trying to implement a feature where i open (suppose in iframe) a PDF file (multiple pages), Highlight a section of the document a get the page number (the one that is displayed in the PDF tool bar).
Eg: if the toolbar display 2/7 which means i am right now in page 2, i need to capture the page number information. Sounds simple but i am not able to get a .dll/function that exposes this property.
Any help would be grateful.Thanks.
I wouldn't think this would be possible, there's no way to control PDFs with JavaScript in the browser, which is what you'd need to do.
This article suggests the same: http://codingforums.com/showthread.php?t=43436.
Content of link:
in short, no, you can't do that.
really don't think JS can read properties of PDFs, since PDFs are viewed in the browser thru a plugin, ie a viewport for another application (for want of a better explanation).
You may be better trying a different route, such as generating the pages as images and implementing your own paging. Depends on your content and requirements, of course. ABCPDF from http://www.websupergoo.com/ is free (with a link-back), not sure if that's any help for you.

Categories