Here's a picture of the output in a Word Search Program I am writing for my granddaughter:
http://www.SwedesDock.com/powerbasic/WS.jpg (note the scan looks grainy but the print is crisp).
And here are the Macros I used to create it:
Code:
'********************************************************************** ' Xprint Macros * '********************************************************************** ' 'centering example from John Petty ' Local DocHeight As Single ' Local DocWidth As Single ' Local HeadText As String ' Local HeadWidth As Single ' Local HeadHeight As Single ' HeadText = "My Heading" ' XPrint Get Client To DocWidth, DocHeight 'Set heading font ' XPrint Text Size HeadText To HeadWidth, HeadHeight ' XPrint Set Pos ((DocWidth - HeadWidth) / 2! , DistanceDownPageIWantHeading") ' ' ' ' Sample calls using Macros: ' 'center title ' xFont_Comic_24: t$ = caption$: x_Center_t ' xFont_Comic_16: t$ = "(" & Trim$(Parm.File_Name) & ")": x_Center_t ' ' 'call at top of sub Macro x_Setup Local f_Letters&, F_Lines&, f_Text_Width!, f_Text_Height! Local x_Col_Posn!, x_Row_Posn!, x_row!, x_col! Local x_Doc_Width!, x_Doc_Height! Local x_Left_Margin& XPrint Get Client To x_Doc_Width, x_Doc_Height 'Page size always 4944, 6457 regardless End Macro ' Macro x_Center_t XPrint Text Size t$ To f_Text_Width!, f_Text_Height! If x_Row > x_Doc_Height - f_Text_Height Then x_Row = 1 XPrint $Ff 'newpage End If XPrint Set Pos ((x_Doc_Width - f_Text_Width) / 2!, x_Row) XPrint t$ x_Row = x_Row + f_Text_Height XPrint Get Pos To x_Col_Posn!, x_Row_Posn! End Macro ' Macro x_Print_t XPrint Text Size Space$(x_Left_Margin) & t$ To f_Text_Width!, f_Text_Height! If x_Row > x_Doc_Height - f_Text_Height Then x_Row = 1 XPrint $Ff 'newpage End If XPrint Set Pos (f_Text_Width!, x_Row) XPrint t$ x_Row = x_Row + f_Text_Height XPrint Get Pos To x_Col_Posn!, x_Row_Posn! End Macro ' Macro x_Center_Bottom_t XPrint Text Size t$ To f_Text_Width!, f_Text_Height! x_Row = x_Doc_Height - f_Text_Height XPrint Set Pos ((x_Doc_Width - f_Text_Width) / 2!, x_Row) XPrint t$ XPrint $Ff 'start new page x_Row = 1 End Macro ' Macro x_Line XPrint Text Size t$ To f_Text_Width!, f_Text_Height! If x_Row > x_Doc_Height - f_Text_Height Then x_Row = 1 XPrint $Ff 'newpage End If XPrint Set Pos ((x_Doc_Width - f_Text_Width) / 2!, x_Row) XPrint t$ End Macro ' Macro xFont_Comic_8 = XPrint Font "Comic Sans MS", 8, 0 : f_letters = 138 Macro xFont_Comic_9 = XPrint Font "Comic Sans MS", 9, 0 : f_letters = 122 Macro xFont_Comic_10 = XPrint Font "Comic Sans MS", 10, 0 : f_letters = 111 Macro xFont_Comic_11 = XPrint Font "Comic Sans MS", 11, 0 : f_letters = 90 Macro xFont_Comic_12 = XPrint Font "Comic Sans MS", 12, 0 : f_letters = 83 Macro xFont_Comic_14 = XPrint Font "Comic Sans MS", 14, 0 : f_letters = 71 Macro xFont_Comic_16 = XPrint Font "Comic Sans MS", 16, 0 : f_letters = 63 Macro xFont_Comic_18 = XPrint Font "Comic Sans MS", 18, 0 : f_letters = 56 Macro xFont_Comic_20 = XPrint Font "Comic Sans MS", 20, 0 : f_letters = 49 Macro xFont_Comic_22 = XPrint Font "Comic Sans MS", 22, 0 : f_letters = 45 Macro xFont_Comic_24 = XPrint Font "Comic Sans MS", 24, 0 : f_letters = 41 : f_lines = 24 Macro xFont_Comic_26 = XPrint Font "Comic Sans MS", 26, 0 : f_letters = 38 Macro xFont_Comic_28 = XPrint Font "Comic Sans MS", 28, 0 : f_letters = 35 Macro xFont_Comic_36 = XPrint Font "Comic Sans MS", 36, 0 : f_letters = 27 Macro xFont_Comic_48 = XPrint Font "Comic Sans MS", 48, 0 : f_letters = 21 Macro xFont_Comic_72 = XPrint Font "Comic Sans MS", 72, 0 : f_letters = 14 ' Macro xFont_Courier_8 = XPrint Font "Courier New", 8, 0 : f_letters = 126 Macro xFont_Courier_9 = XPrint Font "Courier New", 9, 0 : f_letters = 123 Macro xFont_Courier_10 = XPrint Font "Courier New", 10, 0 : f_letters = 102 Macro xFont_Courier_11 = XPrint Font "Courier New", 11, 0 : f_letters = 92 Macro xFont_Courier_12 = XPrint Font "Courier New", 12, 0 : f_letters = 83 Macro xFont_Courier_14 = XPrint Font "Courier New", 14, 0 : f_letters = 71 Macro xFont_Courier_16 = XPrint Font "Courier New", 16, 0 : f_letters = 63 Macro xFont_Courier_18 = XPrint Font "Courier New", 18, 0 : f_letters = 56 Macro xFont_Courier_20 = XPrint Font "Courier New", 20, 0 : f_letters = 49 Macro xFont_Courier_22 = XPrint Font "Courier New", 22, 0 : f_letters = 45 Macro xFont_Courier_24 = XPrint Font "Courier New", 24, 0 : f_letters = 41 Macro xFont_Courier_26 = XPrint Font "Courier New", 26, 0 : f_letters = 38 Macro xFont_Courier_28 = XPrint Font "Courier New", 28, 0 : f_letters = 35 Macro xFont_Courier_36 = XPrint Font "Courier New", 36, 0 : f_letters = 27 Macro xFont_Courier_48 = XPrint Font "Courier New", 48, 0 : f_letters = 21 Macro xFont_Courier_72 = XPrint Font "Courier New", 72, 0 : f_letters = 14 'Bolds Macro xFont_Courier_8b = XPrint Font "Courier New", 8, 1 : f_letters = 126 Macro xFont_Courier_9b = XPrint Font "Courier New", 9, 1 : f_letters = 123 Macro xFont_Courier_10b = XPrint Font "Courier New", 10, 1 : f_letters = 102 Macro xFont_Courier_11b = XPrint Font "Courier New", 11, 1 : f_letters = 92 Macro xFont_Courier_12b = XPrint Font "Courier New", 12, 1 : f_letters = 83 Macro xFont_Courier_14b = XPrint Font "Courier New", 14, 1 : f_letters = 71 Macro xFont_Courier_16b = XPrint Font "Courier New", 16, 1 : f_letters = 63 Macro xFont_Courier_18b = XPrint Font "Courier New", 18, 1 : f_letters = 56 Macro xFont_Courier_20b = XPrint Font "Courier New", 20, 1 : f_letters = 49 Macro xFont_Courier_22b = XPrint Font "Courier New", 22, 1 : f_letters = 45 Macro xFont_Courier_24b = XPrint Font "Courier New", 24, 1 : f_letters = 41 Macro xFont_Courier_26b = XPrint Font "Courier New", 26, 1 : f_letters = 38 Macro xFont_Courier_28b = XPrint Font "Courier New", 28, 1 : f_letters = 35 Macro xFont_Courier_36b = XPrint Font "Courier New", 36, 1 : f_letters = 27 Macro xFont_Courier_48b = XPrint Font "Courier New", 48, 1 : f_letters = 21 Macro xFont_Courier_72b = XPrint Font "Courier New", 72, 1 : f_letters = 14 '********************************************************************** ' End Xprint Macros * '**********************************************************************
If anyone has any suggestions, it's appreciated. I really love this Xprint. Wish I had started using it years ago. Thanks again John, for that example code. It really did the trick for me.
============================================================
Applause waits on success.
Ben Franklin
============================================================
Leave a comment: