Print Txt String To The Default Printer

Print Txt String To The Default Printer

isocam
Collaborator Collaborator
183 Views
1 Reply
Message 1 of 2

Print Txt String To The Default Printer

isocam
Collaborator
Collaborator

Can anybody help?

 

I have a Vb.Net variable, called "TempString". 

 

This variable "TempString" can consist of many lines of text (separated using vbCrLf) that need to be printed, to the default printer, on one or several sheets of paper.

 

Does anybody know how to do this using VbNet?

 

Many thanks in advance!

 

Darren

0 Likes
184 Views
1 Reply
Reply (1)
Message 2 of 2

Michael.Navara
Advisor
Advisor

Printing is a complex task.

  1. If you use an Inventor (this forum is primarily about Inventor) as a background application, you can prepare new drawing, place the text on the sheet(s) and print them using standard printing API.
  2. If you don't have Inventor, you can use some printing scripts using notepad.exe or similar application. Here is similar question. https://www.codeproject.com/Questions/618628/printing-text-directly-to-printer-from-vb-net
  3. Or you can handle the printing yourself. You can use printing support for WinForms applications. More info is here. https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/windows-forms-print-support?view=...

 

0 Likes