Bonjour
Ceci est unexemple qui te permettra de voir comment fonctionne l'impression !
Code : Tout sélectionner
FontID1 = LoadFont(1, "Comic Sans MS", 12)
rc=Chr(13)+Chr(10)
Procedure Open_Window_0()
If OpenWindow(0, 477, 78, 283, 242, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
If CreateGadgetList(WindowID())
EditorGadget(1, 20, 5, 240, 170)
SetGadgetFont(1, FontID1)
ButtonGadget(2, 80, 200, 120, 30, "Impression")
SetGadgetFont(2, FontID1)
EndIf
EndIf
EndProcedure
Open_Window_0()
SetGadgetItemText(1,1,"Ceci est un test d'impression"+rc+"depuis un EditorGadget",0)
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = 1
ElseIf GadgetID = 2
If PrintRequester()
If StartPrinting("PureBasic Test")
If StartDrawing(PrinterOutput())
DrawingFont(LoadFont(2, "Comic Sans MS", 80) )
For n=1 To CountGadgetItems(1)
Locate(100, 160 * n ) : DrawText(GetGadgetItemText(1,n-1,0))
Debug GetGadgetItemText(1,n-1,0)
Next
StopDrawing()
EndIf
StopPrinting()
EndIf
EndIf
EndIf
EndIf
Until Event = #PB_EventCloseWindow
End