hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
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.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
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.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
in visual basic one can use the docmd.outputtext or transfertext to create all kinds of files from database tables
That just outputs text files not "all kinds of files" and certainly not office documents. If that's all you want to do just use the classes in System.IO
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();
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
sorry holly but one create a csv file and then it can be opened as an excell document.
A csv file is not an office document, and you never mentioned CSV before now. Excel is able to read csv files. CSV files are just textfiles.
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.
Have you looked at any of the resources I posted?
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
RTF is also text but you have to learn the arcane formatting:
http://www.biblioscape.com/rtf15_spec.htm
Word can open rtf files.
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.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
csharp can do rtf and rtf has special formatting which i can learn from the link you posted and then the rtf file can be opened from word?
Ok just to split hairs. C# is just a language, the .NET framework has classes that can write text to the filesystem. RTF is text. So yes you can programitically create RTF files by programing the .NET framework using C# syntax as demonstrated yes.
Finally, yes Microsoft Word can open RTF files.
Best of luck with your solution. If you get stuck come back to this thread any time.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
Maybe he can try that XPS API I think it allows for programmatic reading writing of XPS and PDF and the new open Word format
scru
Posting Virtuoso
1,629 posts since Feb 2007
Reputation Points: 975
Solved Threads: 140