Different dimensions between DefautPrinter/PrinterRequester?
Posted: Fri Nov 29, 2019 8:01 pm
Google translation :
Different dimensions between DefautPrinter and PrinterRequester?
Hello everyone,
I have a size problem between the DefautPrinter commands and
PrinterRequester that do not return the same dimensions for the same printer.
Apparently from the comments on the french forum, under Windows dimensions are OK!
If anyone could test under linux, I think the problem may be there!
I am running Linux, Ubuntu 18.04.
Here's what I get with my printers:
Examples to express in Points:
With DefautPrinter With PrintRequester (in Points)
Epson ET2700 559 * 784 578 * 825
Sansung CLP312 559 * 784 570 * 816
Cups PDF 559 * 784 595 * 841
Thank you in advance for testing and telling me.
Note:
I am attached a piece of code to test your printers; do not worry about printing,
just white sheets.
Activate the debugger!
The test consists in a first time to test the (Direct Printing) of the printer by default.
Then in a 2nd time to test the (selected Impression), this time selected with
the Requester. Results in the debugger.
Tell me if there is a difference (Bug!? Or not) like me between DefautPrinter
and PrinterRequester for the same printer!
Different dimensions between DefautPrinter and PrinterRequester?
Hello everyone,
I have a size problem between the DefautPrinter commands and
PrinterRequester that do not return the same dimensions for the same printer.
Apparently from the comments on the french forum, under Windows dimensions are OK!
If anyone could test under linux, I think the problem may be there!
I am running Linux, Ubuntu 18.04.
Here's what I get with my printers:
Examples to express in Points:
With DefautPrinter With PrintRequester (in Points)
Epson ET2700 559 * 784 578 * 825
Sansung CLP312 559 * 784 570 * 816
Cups PDF 559 * 784 595 * 841
Thank you in advance for testing and telling me.
Note:
I am attached a piece of code to test your printers; do not worry about printing,
just white sheets.
Activate the debugger!
The test consists in a first time to test the (Direct Printing) of the printer by default.
Then in a 2nd time to test the (selected Impression), this time selected with
the Requester. Results in the debugger.
Tell me if there is a difference (Bug!? Or not) like me between DefautPrinter
and PrinterRequester for the same printer!
Code: Select all
Enumeration
#f1
#Option1
#Option2
#Bouton
EndEnumeration
Procedure TestImprimante()
Protected NumImp.l
; Ici test impression directe ou pas !
If GetGadgetState(#Option1) = 1 ; Impression en utilisant DefautPrinter
NumImp = DefaultPrinter()
Else ; Impression en utilisant PrintRequester()
NumImp = PrintRequester()
EndIf
If NumImp And StartPrinting("Test")
;Initialisation dessin vectoriel sur la sortie imprimante
If StartVectorDrawing(PrinterVectorOutput(#PB_Unit_Point))
Debug "Dimension (Larg X Haut) = " +StrD(VectorOutputWidth(),0) + "*"+StrD(VectorOutputHeight(),0)
StopVectorDrawing()
EndIf
StopPrinting()
EndIf
EndProcedure
If OpenWindow(#f1, 0, 0, 300, 250, "Exemple...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Debug "Impression avec 'DefautPrinter' "
Debug "Pensez a changer votre imprimante par défaut avant"
Debug "chaque impression et de tester toutes vos imprimantes"
OptionGadget(#Option1, 30, 30, 100, 25, "Impression directe")
OptionGadget(#Option2, 30, 60, 100, 25, "Impression choisie")
ButtonGadget(#Bouton, 50, 100, 200, 40, "Impression")
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case #Option2 : Debug "Impression avec la 'PrintRequester' "
Case #Bouton : TestImprimante()
EndSelect
Case #PB_Event_CloseWindow
f1Quitter = 1
EndSelect
Until f1Quitter = 1
EndIf