' XPRINT Layout — page layout with GDI positioning
#COMPILE EXE
#DIM ALL

DECLARE FUNCTION CreateDC LIB "GDI32.DLL" ALIAS "CreateDCA" (BYVAL lpDriverName AS ASCIIZ, BYVAL lpDeviceName AS ASCIIZ, BYVAL lpOutput AS ASCIIZ, BYVAL lpInitData AS LONG) AS LONG
DECLARE FUNCTION DeleteDC LIB "GDI32.DLL" (BYVAL hDC AS LONG) AS LONG
DECLARE FUNCTION TextOut LIB "GDI32.DLL" ALIAS "TextOutA" (BYVAL hDC AS LONG, BYVAL x AS LONG, BYVAL y AS LONG, BYVAL lpString AS ASCIIZ, BYVAL nCount AS LONG) AS LONG

FUNCTION PBMAIN() AS LONG
    PRINT "XPRINT Layout via GDI:"
    PRINT "- Use TextOut with absolute coordinates"
    PRINT "- Track Y position for columns"
    PRINT "- Use SetTextAlign for justification"
    PRINT "- Draw lines as separators"
    PRINT "All GDI drawing works on printer DC"
    FUNCTION = 0
END FUNCTION
