| | |
create pdf or word file from within c#
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 164
Reputation:
Solved Threads: 1
Hi.
I am currently working on a quote system project. The final step of the quote would be to print the quote.
Does anyone know whether it is possible to create a pdf file with c# coding? even if i first have to create something else like a XML file it would be OK. I just need to know whether it is possible and a few clues or ideas as to how to do it.
Although preference is for pdf a word document would also be fine.
I would really appreciate your help. Thank you.
I am currently working on a quote system project. The final step of the quote would be to print the quote.
Does anyone know whether it is possible to create a pdf file with c# coding? even if i first have to create something else like a XML file it would be OK. I just need to know whether it is possible and a few clues or ideas as to how to do it.
Although preference is for pdf a word document would also be fine.
I would really appreciate your help. Thank you.
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
We use a third party component to do that kind of thing. http://www.aspose.com/
There are other options, crystal reports can create pdf output too.
If your budget is 0 here are some open source c# libraries:
http://csharp-source.net/open-source/pdf-libraries
There are other options, crystal reports can create pdf output too.
If your budget is 0 here are some open source c# libraries:
http://csharp-source.net/open-source/pdf-libraries
Last edited by hollystyles; Sep 27th, 2007 at 5:08 am.
If you fancy it (and have like a couple of years) you can implement your own. Here's the standard:
http://www.adobe.com/devnet/pdf/pdf_reference.html
You will need to understand PostScript, vector and raster graphics, font embedding and data compression.
http://www.adobe.com/devnet/pdf/pdf_reference.html
You will need to understand PostScript, vector and raster graphics, font embedding and data compression.
Last edited by hollystyles; Sep 27th, 2007 at 5:08 am.
•
•
Join Date: Aug 2007
Posts: 164
Reputation:
Solved Threads: 1
thank you holly but i think i made a mistake asking what i asked.
perhaps i should just ask how to create a word document from C# and then the word document can be converted to pdf with some pdf tool.
so can anyone give me some idea how to go about creating word documents from within C# code?
perhaps i should just ask how to create a word document from C# and then the word document can be converted to pdf with some pdf tool.
so can anyone give me some idea how to go about creating word documents from within C# code?
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
Aspose does that too. I have used myLittleWriter in the past which is a free tool that creates rtf (Word can open them just fine)
But I don't get it. Why output a doc and then convert it? why not just output straight to pdf? Or is it a requirement that the user has a choice of output format?
Maybe this is what you're after?
http://msdn2.microsoft.com/en-us/library/bb735940.aspx
But only Office 2007 will be able to open them, prior versions your outta luck.
But I don't get it. Why output a doc and then convert it? why not just output straight to pdf? Or is it a requirement that the user has a choice of output format?
Maybe this is what you're after?
http://msdn2.microsoft.com/en-us/library/bb735940.aspx
But only Office 2007 will be able to open them, prior versions your outta luck.
Last edited by hollystyles; Sep 27th, 2007 at 7:15 am.
•
•
Join Date: Aug 2007
Posts: 164
Reputation:
Solved Threads: 1
it does not really matter that it is first a word document and then pdf. it is just that the program's output must be in some electronic document format like word or pdf.
instead of printing the screen output and sending it via mail it has to be saved as a document so that it can be e-mailed.
in visual basic one can use the docmd.outputtext or transfertext to create all kinds of files from database tables but i dont know the C# equivalent for that.
instead of printing the screen output and sending it via mail it has to be saved as a document so that it can be e-mailed.
in visual basic one can use the docmd.outputtext or transfertext to create all kinds of files from database tables but i dont know the C# equivalent for that.
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
•
•
•
•
in visual basic one can use the docmd.outputtext or transfertext to create all kinds of files from database tables
C# Syntax (Toggle Plain Text)
using System.IO; // create a writer and open the file TextWriter tw = new StreamWriter("test.txt"); // write a line of text to the file tw.WriteLine("My output..."); // close the stream tw.Close();
•
•
Join Date: Aug 2007
Posts: 164
Reputation:
Solved Threads: 1
sorry holly but one create a csv file and then it can be opened as an excell document.
anyway. just creating an ordinary file might be my only answer. but is dot txt the only way to go? can one not use RTF or DOC? the problem is i need to have some formatting in. like bold or something.
anyway. just creating an ordinary file might be my only answer. but is dot txt the only way to go? can one not use RTF or DOC? the problem is i need to have some formatting in. like bold or something.
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
•
•
•
•
sorry holly but one create a csv file and then it can be opened as an excell document.
C# Syntax (Toggle Plain Text)
using System.IO; // create a writer and open the file TextWriter tw = new StreamWriter("test.csv"); // write a line of text to the file tw.WriteLine("\"col1\",\"col2\",\"col3\""); // close the stream tw.Close();
•
•
•
•
can one not use RTF or DOC? the problem is i need to have some formatting in. like bold or something.
Last edited by hollystyles; Sep 27th, 2007 at 11:07 am.
RTF is also text but you have to learn the arcane formatting:
http://www.biblioscape.com/rtf15_spec.htm
Word can open rtf files.
DOC
MS Word docs are proprietary (company secret) binary file, not text. Many clever developers have backward engineered the binary format and give us handy libraries such as Aspose that I mentioned earlier. But you can't just docmd.writeworddocument in any language I'm afraid.
http://www.biblioscape.com/rtf15_spec.htm
Word can open rtf files.
C# Syntax (Toggle Plain Text)
using System.IO; // create a writer and open the file TextWriter tw = new StreamWriter("test.rtf"); // write a line of text to the file tw.WriteLine("{\\rtf1{\\info{\\title some data}{\\author Ravenous Wolf}}\\par\\b Created: using c#\\b0\\tab\\par\\b\\b0\\tab\\tab\\line\\par"); // close the stream tw.Close(); }
DOC
MS Word docs are proprietary (company secret) binary file, not text. Many clever developers have backward engineered the binary format and give us handy libraries such as Aspose that I mentioned earlier. But you can't just docmd.writeworddocument in any language I'm afraid.
Last edited by hollystyles; Sep 27th, 2007 at 11:28 am.
![]() |
Similar Threads
- create pdf from excel etc. visual basic 6.0 (Visual Basic 4 / 5 / 6)
- How to create PDF file from VB (Visual Basic 4 / 5 / 6)
- Generate Report as PDF and Excel file (Java)
- I want to Create PDF file from Delphi,Pls help me (Pascal and Delphi)
- Find word in file!! (C++)
- How to COmpare a word file and an XML file (C#)
- Creating PDF in MS Apps fails (Windows NT / 2000 / XP)
- Reading pascal file and searching for a particular word in that file (Pascal and Delphi)
- How to write the new line existing pdf file using php (PHP)
- how to upload a ms word file and store it in sql table (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Centralized data in .NET?
- Next Thread: database connectivity
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






