 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Thu Oct 23, 2014 6:29 pm Post subject: Output to Printer |
|
|
I've been experimenting with PRINTER_OPEN and HTML_PRINTER_OPEN, and after a few hours of experimenting, I have a couple of questions.
1. Does HTML_PRINTER_OPEN perform the appropriate rendering based on the HTML commands? I don't see that when writing through the Adobe PDF driver, nor when writing directly to either my PS or PCL6 printer driver.
2. If I'm willing to keep life "simple" and use PRINTER_OPEN, how do I specify the font size to be used (and by extension, line spacing) and orientation (portrait or landscape)? The latter might be selected at the invocation of the printer driver, which is OK, but the font size default is HUGE!
Thanks in advance,
Bill |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Oct 24, 2014 8:24 am Post subject: |
|
|
The native ClearWin+ HTML engine uses a subset a a subset of HTML.
See ftn95.chm under FTN95->Win32 platform->ClearWin+->Hypertext windows.
As far as I know, you should be able to set the font and font size for printer output but I have not tested this for you. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Fri Oct 24, 2014 10:43 am Post subject: |
|
|
If you happened to have a parallel port and a printer attached to it that wasn't a 'Windows printer', then using OPEN with LPT: works - at least it used to. (Haven't used it since Windows 2000!) It's some time since I had such a printer or even a parallel port.
You then have 3 types of printer options:
1. Printing HTML, but remember only a subset of HTML is supported and the font control is weak),
2. Using your printer as a graphics device, which requires you to find its metrics, then position everything on the page. The full range of Clearwin+ graphics is available, so you can mix text and graphics, select fonts etc. This is where you get with functions OPEN_PRINTER@ and OPEN_PRINTER1@ (The OpenGL printer options work in the same way - but I've never tried them).
3. Using the printer for FORMATted output. This is where you have to use the standard callback PRINTER_OPEN or PRINTER_OPEN1 to a Clearwin+ menu or button, which allows you to associate a Fortran device number with a specific printer (or use the default printer).
In my view, 2 and 3 are a bit topsy-turvy, because unless you have Clearwin+ windows 2 is pointless, and 3 is inaccessible!
SET_PRINTER_ORIENTATION@ sets the initial orientation for the page, but the user can reset this in the printer selection dialog, and your choice cannot be relied upon!
The following is a simple (but awful) example of getting device 99 associated with a printer for FORMATted output.
Code: | PROGRAM PRINT
INCLUDE <WINDOWS.INS>
EXTERNAL NULL
I=WINIO@('%ca[Print]Hello World%2nl%6^bt[Print]',
& 'PRINTER_OPEN',99,NULL)
WRITE(99,'("Hello World")')
CLOSE (99)
END
INTEGER FUNCTION NULL()
NULL = 0
RETURN
END |
The example uses the standard printer's default font.
Eddie
(But watch the continuation line position of & if you copy the above - it seems to have gained an extra space in front of it). |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Fri Oct 24, 2014 3:32 pm Post subject: |
|
|
Thanks for the response. I was afraid that it might not be quite what I was looking for. The existing code relies very heavily on formatting via Fortran print codes (i.e. 1,+,0, etc.). I actually have a customer that has maintained a parallel port system with a dot-matrix printer for this software package. But, I want to get past those days!
What I may be forced to do is link to my PDF generator code (C++) and perform the page creation there, then automatically print the resulting PDF (or let the user chose to do it).
Nothing is easy anymore!  |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Fri Oct 24, 2014 3:41 pm Post subject: |
|
|
You can also read this forum post:
Direct printer access from FTN95 program
The example I wrote above follows the Fortran carriage control sequences, I was just too idle to write them. You could get the association between the printer and the device number by having a Clearwin+ sequence like in my example, associating it with a %sc startup code instead of a button.
Eddie |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Sat Jan 03, 2015 12:36 am Post subject: |
|
|
This is to close out this thread.
I was able to completely integrate my PDF generation software, and now have a DRIVER method for generating PDF files that the user can later print.
While it has a couple of minor limitations, it works very well and the interface is very simple for FORTRAN formatted output. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|