HMG Tutorials & Tips

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Try demo, prtest01.prg

    CODE:

    #include <hmg.ch>*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._./*   HMG Print ( Mini Print ) for beginners in 10 easy steps      Step #1  :      Use everything with default values,      write only "This is a test"        to four corners and center of paper.   */PROCEDURE  PrintTest()   /*      Default paper size is A4 Sheet; 210- by 297-millimeters   */      LOCAL lSuccess := .F.,;         cTestString   := "This is a test",;         nMostRightCol := 210,;  // Default page size is A4 : 210 x 297 mm         nMostBottmRow := 297      SELECT PRINTER DEFAULT TO lSuccess PREVIEW       IF lSuccess      START PRINTDOC          START PRINTPAGE             @ 0, 0 PRINT cTestString                                    // Top Left                @ 0, nMostRightCol PRINT cTestString  RIGHT                    // Top Right             @ nMostBottmRow / 2, nMostRightCol / 2  PRINT cTestString CENTER  // Center of paper             @ nMostBottmRow - 4, 0 PRINT cTestString                       // Bottom Left                @ nMostBottmRow - 4, nMostRightCol PRINT cTestString RIGHT       // Bottom Right         END PRINTPAGE                   END PRINTDOC   ELSE      MsgStop( "Couldn't select default printer !", "ERROR !" )   ENDIF      RETURN  // PrintTest()*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
    dimensions are in mm, just adjust where to print and add RIGHT or CENTER, LEFT is defaults
    FONT and SIZE are some of the windows fonts

    Statistics: Posted by dragancesu — Sun Feb 09, 2020 5:52 pm


  2. Printing certainly is one of the hardest things, and can i ask for some help, please?

    The samples are very useful, but I am struggling with trying to right-justify text. Any tips on this?

    I've used <RightMargin> - LEN( TextString ) + nCharWidth
    but it still isn't quite right.
    Yemplar

    Statistics: Posted by Templar — Sun Feb 09, 2020 2:43 pm


  3. Thx, Dragan, I was hoping this.

    Robert

    Statistics: Posted by ROBROS — Wed Feb 05, 2020 12:26 pm


  4. No worries, recognizes all printers as well as pdf printers (print to pdf)

    Statistics: Posted by dragancesu — Wed Feb 05, 2020 9:51 am


  5. Hi, Ihave a question:
    Does printsystem work with windows 10? I mean is the default printer recognized? I can't try, because I use win 7 in VirtualBox.

    Thx
    Robert

    Statistics: Posted by ROBROS — Tue Feb 04, 2020 3:12 pm