blah blah blah is here! blah blah » Close

up0down
link

I'm just creating a simple calculator in C# (windows form)
.
I've created a "User Help" which is a pdf file, what I want is to display that pdf file if the user clicks on the "Help" button in the WinForm. If assumed that Adobe reader is pre-installed on the user's machine....
.
How to open the pdf file on button click in winForm?
.

I don't plan to provide this pdf file on hard disk of user. Which means that I have to embed this pdf into the calculator (winForm) and have to display it on the button click.
.
Kindly guide me for displaying an embedded file in winForm.

last answered one month ago

3 answers

up0down
link

a pdf is a pdf and needs an engine to start which is the adobe acrobat reader. but there is still something similar to pdf which is microsoft xps and its internally found in the framework. google how to implement an xps file in ur applicaiton.

up0down
link

I would recommend using Crystal Reports for this. You can implement a report-viewer into your application and show your .rpt file in it. The viewer can also export the report to PDF if needed.

gsvirdi
71

Ohhhh GOD!!!! Kindly don't scare me with BIG BIG names..... I can use Process.Start("C:\\Documents and Settings\\gsv\\Desktop\\mother.pdf"); but only thing I want is to find an alternative to "giving the path". Can a file be called from with-in the winForm and displayed?? Irrespective of the existence of file a new user's computer? :)

up0down
link

if you want to stick with pdf try first showing ur pdf on the winform, maybe this pdfsharp sdk will help:
http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=54&Itemid=64

gsvirdi
71

I think it would be best to go in a simple way. Include the pdf in the application, copy the file in the output directory and open. Can u help me with this one: How to delete that file in the output directory (in the same folder having .exe) after the application is closed??

muster
663

if you want to do the process start thing then its not a good way to delete a file simply because of another process being in control. for example the user openned the pdf and closed the software, delete won't be applied if the user is still using the pdf file "inaccessible". even if this happen then why don't u keep the pdf on the HD since its always being openned by the user. another safe thing you can do beside the pdf is images, try getting the pages of the pdf you have into set of images and store them in the resources of the software, and whenever you want you can scroll them in the form as set images. but still you can learn how to use the pdfsharp sdk and get the result needed this way.

Feedback