Previous topic Next topic
HBPRINTER SAMPLE
Help > Libraries > HBPRINTER >

/////////////////////////////////////////////////////////////////////
// HBPRINTER SAMPLE
/////////////////////////////////////////////////////////////////////

      INIT PRINTSYS
      SELECT DEFAULT PREVIEW
      DEFINE FONT "F0" NAME "Courier New" SIZE 24
      START DOC
         FOR i := 1 TO 10
            START PAGE
               @ 10,10 SAY "Page" + STR( i ) FONT "F0" TO PRINT
            END PAGE
         NEXT i
      END DOC
      RELEASE PRINTSYS

Hints:

The best way to get the most similiar printout on various printers is to use SET UNITS MM, remembering to use margins large enough for all printers.
When setting units to ROWCOL, you must consider that the font is not mapped exactly in the same way by different printer drivers.
Row height is measured using mapped printer DC font, so, its slightly different on different printers.
This is why the printout varies on different printers.
When setting units to MM, the printout position is calculated using printer resolution in pixels-per-inch, so this method is more exact than setting units to ROWCOL.
Remember that the preview shows only the printable area and not the whole paper area.

Case MM (note that point 0,0 is the upper left corner of the paper area):

SET UNITS MM
@ 5, 5 PICTURE "info.bmp" size 15, 10

graphic


Case ROWCOL (note that point 0,0 is the upper left corner of the printable area):

SET UNITS ROWCOL
DEFINE FONT "F0" NAME "Courier New" SIZE 40
@ 0, 0 PICTURE "info.bmp" size 2, 3
@ 3, 0 SAY "This is a text" FONT "F0" TO PRINT

graphic



The content of this page is derived from the MiniGui Extended help manual.
(c) MiniGUI Team (Grigory Filatov, Jacek Kubica, Janusz Pora)
You can access the original work at https://sourceforge.net/projects/hmgs-minigui/