It is currently Thu Jan 28, 2021 2:59 am

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Different dimensions between DefautPrinter/PrinterRequester?
PostPosted: Fri Nov 29, 2019 8:01 pm 
User avatar

Joined: Wed Jan 23, 2008 12:45 pm
Posts: 45
Location: France, Montpellier
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. :wink:

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!



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()

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)


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")
Select WaitWindowEvent()
Case #PB_Event_Gadget
            Select EventGadget()
      Case #Option2   :   Debug "Impression avec la 'PrintRequester' "

      Case #Bouton :   TestImprimante()   

Case #PB_Event_CloseWindow
                  f1Quitter = 1
Until f1Quitter = 1


Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 39 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye