C WinForm Open the PDF file and display it in the form

  • 2021-09-20 21:21:30
  • OfStack

1. Add a reference

Toolbox--Right--Select Items--COM Components--Adobe PDF Reader

2. How to use it


OpenFileDialog openFile=new OpenFileDialog();
open..Filter = "PDF Documents |*.pdf";
openFile.ShowDialog();
axAcroPDF1.src = openFile.FileName;
//axAcroPDF1.LoadFile(of.FileName);   // Usage 2

In addition to this method, there are some open source projects on the Internet, which can directly open PDF files, and you can also refer to the following

http://www.codeproject.com/KB/silverlight/BlendPDFwithSilverlight.aspx

http://www.codeproject.com/KB/applications/PDFViewerControl.aspx


Related articles: