Question
C#: Display a pdf in WindowForm
Hello!
I am reading the documentation and this forum for a few days, but my problem isn't really solved.
I want to display a pdf document in a WindowForm in C#.
CAcroPDDoc pdDoc = new AcroPDDocClass();
pdDoc.Open("C:\\test.pdf");
CAcroPDPage pdPage;
pdPage = (CAcroPDPage)pdDoc.AcquirePage(0);
AcroRect rect = new AcroRect();
rect.Left = 0;
rect.Top = 0;
rect.right = 1000;
rect.bottom = 1000;
pdPage.DrawEx(0, 0, rect, 0, 0, 100);
With this, I am able to display or render the first page of a document. It's just rendered, nothing more. I read, that I can implement a piece of the acrobat reader, so that I don't have to implement everything on my own.
I think this is something like this:
CAcroAVDoc avDoc = new AcroAVDocClass();
avDoc.Open("C:\\test.pdf", "Test");
But I don't know how to display this pdf in my application. What I want to do is to open a new window and display a pdf + some extra functions, that i want to code on my own. I thought about the BrowserComponent of VisualStudio, but there I am only having control of which page to display, but no chance to get the actual displayed page, right?
I want to get the actual page and set the page when the document is opening.
It would be very great if you could help me. I really don't know a good solution for this and my trials all didn't work.
Thank you very much for your reply,
Manuel
I am reading the documentation and this forum for a few days, but my problem isn't really solved.
I want to display a pdf document in a WindowForm in C#.
CAcroPDDoc pdDoc = new AcroPDDocClass();
pdDoc.Open("C:\\test.pdf");
CAcroPDPage pdPage;
pdPage = (CAcroPDPage)pdDoc.AcquirePage(0);
AcroRect rect = new AcroRect();
rect.Left = 0;
rect.Top = 0;
rect.right = 1000;
rect.bottom = 1000;
pdPage.DrawEx(0, 0, rect, 0, 0, 100);
With this, I am able to display or render the first page of a document. It's just rendered, nothing more. I read, that I can implement a piece of the acrobat reader, so that I don't have to implement everything on my own.
I think this is something like this:
CAcroAVDoc avDoc = new AcroAVDocClass();
avDoc.Open("C:\\test.pdf", "Test");
But I don't know how to display this pdf in my application. What I want to do is to open a new window and display a pdf + some extra functions, that i want to code on my own. I thought about the BrowserComponent of VisualStudio, but there I am only having control of which page to display, but no chance to get the actual displayed page, right?
I want to get the actual page and set the page when the document is opening.
It would be very great if you could help me. I really don't know a good solution for this and my trials all didn't work.
Thank you very much for your reply,
Manuel
