By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Printing proprietary formats

P: n/a
Dan
We are running into trouble when trying to print
proprietary formats (ie; .pdf, .xls, .doc, etc.) from our
VB.NET application.

Binary files generate garbage when printed.

We have no trouble printing text files using .NET objects
such as System.Drawing.Printing.PrintDocument and would
like to do the same thing with binary files without having
to go through multiple APIs.

Does anyone have any suggestions or ideas about this?

Thanks in advance for any assistance.
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Text files are a known format. All the file formats you mentioned have application-specific information embedded with the actual data, so you can't just tell them to print like a text document and expect to get any kind of intelligible output

You either have to use the application's libraries to print with (like starting an instance of Word, loading your .doc file and printing it. This would require Word to be installed on the machine running the app), become familiar with the file format to the point where you can reliably pull the data you want out of it, or purchase or otherwise aquire third party software that allows you to print these formats

That sort of goes along with the concept of a proprietary file format. This is exactly the reason XML is so popular today. It gets rid of all these sorts of problems, at the expense of file size and speed, among other things.
Nov 20 '05 #2

P: n/a
* "Dan" <an*******@discussions.microsoft.com> scripsit:
We are running into trouble when trying to print
proprietary formats (ie; .pdf, .xls, .doc, etc.) from our
VB.NET application.

Binary files generate garbage when printed.

We have no trouble printing text files using .NET objects
such as System.Drawing.Printing.PrintDocument and would
like to do the same thing with binary files without having
to go through multiple APIs.


That's not possible.

You can start the associated application with the print verb:

\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.htm"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.