Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Which reference do I add in winform references to read .pdf files?
Thanks
Posted
Comments
arkiboys 24-Feb-12 10:37am    
I do not find a reference to AxAcroPDFLib

1 solution

ou can reference the Adobe Reader ActiveX control and bundle it with your application.

C#
AxAcroPDFLib.AxAcroPDF pdf = new AxAcroPDFLib.AxAcroPDF();
pdf.Dock = System.Windows.Forms.DockStyle.Fill;
pdf.Enabled = true;
pdf.Location = new System.Drawing.Point(0, 0);
pdf.Name = "pdfReader";
pdf.OcxState = ((System.Windows.Forms.AxHost.State)(new System.ComponentModel.ComponentResourceManager(typeof(ViewerWindow)).GetObject("pdfReader.OcxState")));
pdf.TabIndex = 1;

// Add pdf viewer to current form        
this.Controls.Add(pdf);

pdf.LoadFile(@"C:\MyPDF.pdf");
pdf.setView("Fit");
pdf.Visible = true;
 
Share this answer
 

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