Highlighted
Absent Member.
Absent Member.
1617 views

Print a PRN file directly to a printer

Jump to solution

Hi All,

Im trying to print a file I've already created call c:\tmp\NeilTest.prn directly to a printer using Visual Cobol, is there a clever .NET way of doing this?

I found below but not sure if this is the best way or if it would work in VC?

http://stackoverflow.com/questions/4435644/how-to-print-batch-file-in-vb-net

Many thanks

Neil.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Print a PRN file directly to a printer

Jump to solution

There are many ways of printing in .NET. I believe that our knowledgebase contains several samples.

The simplest method of sending an existing file to the printer is probably by using the PC_PRINT_FILE routine which is part of the standard MF library.

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Print a PRN file directly to a printer

Jump to solution

There are many ways of printing in .NET. I believe that our knowledgebase contains several samples.

The simplest method of sending an existing file to the printer is probably by using the PC_PRINT_FILE routine which is part of the standard MF library.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Print a PRN file directly to a printer

Jump to solution

is PC_PRINT_FILE native code? if so ive been advised not to use that as all my projects are fully managed .net. i really need a .NET way of doing this, if such a thing exists.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Print a PRN file directly to a printer

Jump to solution

There is a managed version of PC_PRINT_FILE that will be called when you are using managed code. If you are using native code then the native version will be called.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.