Click here to Skip to main content
15,884,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am doing project in windows application...my form1 contain different textbox ....once i fill data in textbox after that when i click on button that detail of form1 need to show in pdf.....please tell me easy method to do...
Posted

check out this link.
http://stackoverflow.com/questions/4504442/viewing-pdf-in-windows-forms-using-c-sharp[^]

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/f3cbbdec-7e35-46e2-ba8d-b7c78e108e35/[^]

Make sure you get the necessary dll first.
%programfiles&\Common Files\Adobe\Acrobat\ActiveX\AcroPDF.dll

C#
private void InitializeAdobe(string filePath)
{
    try
    {
        this.axAcroPDF1.LoadFile(filePath);
        this.axAcroPDF1.src = filePath;
        this.axAcroPDF1.setShowToolbar(false);
        this.axAcroPDF1.setView("FitH");
        this.axAcroPDF1.setLayoutMode("SinglePage");
        this.axAcroPDF1.Show();
    }
    catch (Exception ex)
    {
        throw;
    }
}


When form closes.

C#
this.axAcroPDF1.Dispose();
this.axAcroPDF1 = null;


Please mark as solution if this solves your problem and vote. Thanks
 
Share this answer
 
can u please tell me how to do this...i tried a lot...output is not getting....
 
Share this answer
 
Comments
André Kraak 26-Feb-12 10:16am    
If you have a question about or comment on a given solution use the "Have a Question or Comment?" option beneath the solution. When using this option the person who gave the solution gets an e-mail message and knows you placed a comment and can respond if he/she wants.

Please move the content of this solution to the solution you are commenting on and remove the solution.
Thank you.
schiranjeevi2007 4-Jul-12 17:07pm    
How to disable print for pdf in this code
There is a third party component which used to view and edit the pdf easily download it using the key "ITextSharp" in search engine
 
Share this answer
 
May be you didn't carefully go through solution of Mr Dean. Follow these steps
1)In toolbox right click and select choose items
->COM components ->Check Adobe pdf readerand click OK
2)The control for PDF reader gets added to toolbox place it on the form and
use the code as given by Mr Dean.
Pls mark his answer too...


Best of luck........!
 
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