Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Win_print Direct

jwyoung40
Beginner
1,362 Views
I am trying to user Win_print Direct to print to a USB
printer on an XP home system. (Visual Fortran 6.6). I have no problem writing records to XP system devices such as Zip Drive etc. After trying many approaches I
need some help in getting this part of the project going.
(I am working around this at the moment by writing output data to a file and then, using another language, printing the data.)

Is there a simplified "how to do it" source available?

Thanks,

Joe Young

0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,362 Views
WinPrintDirect is specifically for the case where you are printing to a device that uses embedded control characters to affect printing, rather than simply a bitmap rendering. Examples include PostScript printers and HP-GL plotters. If your printer is an ordinary bitmap-type printer, you would not use WinPrintDirect, but rather WinPrint.

An example of using WinPrintDirect for printing a PostScript file is:

program forprint
use Fortran_WinPrintDirect
integer istat

open (unit=1,file='doc.ps',form='formatted',status='old',action='read')
istat =  Print_Direct (1, Default_Printer=.FALSE.)
close (1)
end


An example of using WinPrint is provided in the CVF samples under MISCFORPRINT.

Steve
0 Kudos
jwyoung40
Beginner
1,362 Views
Thanks, Steve. I appreciate your assistance.
Joe Young
0 Kudos
jwyoung40
Beginner
1,362 Views
Hello Steve,

You wrote: "An example of using WinPrint is provided in the CVF samples under MISCFORPRINT."

I have looked for over an hour and I cannot find this
information. I even checked my Visual Fortran distribution CD.

Do you have a URL where I can find the samples?

Thank you,

Joe Young
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
The source code for both WinPrint and WinPrintDirect is at http://compaq.com/fortran/examples The "sample program" for WinPrint is little more than the one I showed above with the module and routine name changed.

Steve
0 Kudos
jwyoung40
Beginner
1,362 Views
Thank you. I have it now.
Joe Young
0 Kudos
jwyoung40
Beginner
1,362 Views
I have been playing with this for a few hours now and I am still missing something...probably something simple :) When I run the program I receive an error indicating that I have tried to use the WinPrint module
before it was declared as a module. If I comment out the
three lines that pertain to WinPrint the program runs fine. I have attached the code for this program.
Thanks,
Joe Young
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
You have the source for the module after the use of it. Fortran requires that the module be "defined" before you use it. Either move the module to the beginning of the source file or, better, split the module into a separate source file in your project. If you are using the IDE, it will automatically get built first, otherwise you'll need to make sure it is compiled first.

Steve
0 Kudos
jwyoung40
Beginner
1,362 Views
Thanks for help. Have a good weekend.
Joe Young
0 Kudos
jwyoung40
Beginner
1,362 Views
WinPrint is working now. Thanks for your help. What a
change in FORTRAN since the last I used (HP 4X). This is
great. Back to the books.

Joe Young
0 Kudos
Steven_L_Intel1
Employee
1,362 Views
Yes, I imagine that modern Fortran 95 code looks rather alien to someone used to FORTRAN IV.

I'm glad to hear that it works for you.

Steve
0 Kudos
Reply