Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am loading a pdf document into System.Windows.Forms.WebBrowser Control using below code.

C#
pdfPath="E:\\Projects\\RD\\bin\\Debug\\pdfdocument.pdf";
webBrControl.Navigate("about:blank");
webBrControl.DocumentText = "<html></html>";
webBrControl.Navigate(pdfPath);
webBrControl.Dock = DockStyle.Fill;


The pdf loads fine.

Now on click of a button I want to scroll to document to next page #2 or scroll vertically to a certain point.

I tried following:
C#
webBrControl.Navigate(pdfPath+"#page=2");


But instead of scrolling the pdf area greys out.
Can anyone help me how to scroll Web Browser Control?

Thanks & Regards
Shankar
Posted
Updated 30-Mar-20 10:31am
Comments
gggustafson 2-Apr-20 14:50pm    
The WebBrowser of Windows Forms does not know anything about PDF. It is using a built-in that allows the browser to view PDFs. But navigation within the PDF is not supported. You may want to search Google for "C# PDF Viewer". Good Luck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900