Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
I am working on wpf application.... In my application I have billing section ... After the bill generation I want to place that total view of the bill into a pdf file and download it for the User....Please provide the code for downloading the content of window into pdf file?

Posted
Updated 10-Dec-13 21:20pm
v4
Comments
Sergey Alexandrovich Kryukov 11-Dec-13 3:04am    
The term "downloading" is applicable only to getting of copy of something from some remote service...
This is not a question, anyway.
—SA

1 solution

Usually we don't answer "GimmeCode" non-questions (this is not a question, because "can anyone… ?" cannot be counted as a question), but in this particular case, a purely technical/"scientific" answer is possible: no one can give you such code by one principle reason: there is no unambiguous "conversion" from one to another, because the two kinds of object have different concept leaving no possibility for one-to-one correspondence. PDF file is something like an electronic paper, all data represented in a fixed way. An application window, in contrast, is fluid, it takes different shapes depending on screen and window size and the state of the application, entered data, and anything like that. The problem is just ambiguous.

It does not mean that the code doing something like this to meet certain requirements cannot be written. It's just that no one can give it to you based on your question. There are two flows of input needed to get to such a task: 1) your application itself, as it is before implementing such feature, 2) the mapping rules which would describe how the state of the application should be mapped on PDF output.

For creation of PDF, you can iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

In included the reference to Java iText site as well, because most documentation is there. If you understand C#, it would not be difficult to understand Java-bases API documentation.

—SA
 
Share this answer
 
v2

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