Page 1 of 7
PrinterLib 1.10
Posted: Mon Aug 23, 2010 7:27 am
by akee
Tried to fine the PrinterLib topic but could not find it.
I tried getting the Print Properties window but could not get it running. Then I looked at the code, I am wondering if
PrinterProperties_(0,PrintLib_PH) should be
PrinterProperties_(hwnd,PrintLib_PH)?
Code: Select all
ProcedureDLL.l Print_Properties(Window.i)
If IsWindow(Window)
hwnd=WindowID(Window)
Else
hwnd=0
EndIf
ProcedureReturn PrinterProperties_(0,PrintLib_PH)
EndProcedure
ProcedureDLL.l Print_AdvancedProperties(Window.i)
If IsWindow(Window)
hwnd=WindowID(Window)
Else
hwnd=0
EndIf
ProcedureReturn AdvancedDocumentProperties_(0,PrintLib_PH,PrintLib_PN,@dummy,0)
EndProcedure
Re: PrinterLib 1.10
Posted: Mon Aug 23, 2010 7:57 am
by ABBKlaus
at first you have to open a printer to get it working :
Code: Select all
OPT$="Orientation=" + Str(#DMORIENT_PORTRAIT) + ","
OPT$+"Papersize=" + Str(#DMPAPER_A4)
If Print_OpenPrinter("",OPT$)
Print_AdvancedProperties(-1)
...
EndIf
Re: PrinterLib 1.10
Posted: Mon Aug 23, 2010 8:17 am
by akee
Thanks ABBKlaus...

Re: PrinterLib 1.10
Posted: Tue Aug 31, 2010 7:21 pm
by akee
I searched the forums and examples and I have another question...
What is the equivalent of DrawRotatedText() in Printer Lib?
Thanks...

Re: PrinterLib 1.10
Posted: Wed Sep 01, 2010 8:00 am
by ABBKlaus
akee wrote:What is the equivalent of DrawRotatedText() in Printer Lib?
Its hidden inside the Print_Font() command.
Code: Select all
Print_Font(Font$, Height.l [, Flags.l [, Rotate.l]])
Description:
Changes the current font.
Flags can be a combination of the following :
#PB_Font_Bold
#PB_Font_Italic
#PB_Font_Underline
#PB_Font_StrikeOut
#PB_Font_HighQuality
#PB_Font_HighQuality + 1 = Antialised Quality
#PB_Font_HighQuality + 2 = Cleartype Quality
'Rotate' specifies the angle, in tenths of degrees.
Re: PrinterLib 1.10
Posted: Thu Sep 02, 2010 5:49 am
by akee
Oh ok... Thanks again ABBKlaus...

Excellent support... Come to think of it, it is better than Microsoft or Apple... ;p
Re: PrinterLib 1.10
Posted: Tue Jul 19, 2011 10:03 pm
by akee
The following code got my laser warmed up but nothing gets printed.
Code: Select all
t_printer_title$ = "MyJob"
If Print_OpenPrinter()
Print_StartDoc(t_printer_title$)
Print_Font("Calibri", 50)
Print_WriteStringN(t_printer_title$)
For a = 1 To 10
Print_WriteStringN("Line " + Str(a))
Next
Print_EndDocPrinter()
EndIf
The Example 02 - Raw Print does the same as well...
Re: PrinterLib 1.10
Posted: Tue Jul 19, 2011 10:33 pm
by ABBKlaus
I'm guessing you are trying to print some text in raw mode !?
Well the printer only prints something it does understand and i don't know what model you are dealing with and what emulation is neccessary to print in raw mode.
I hope that at least the preview sample prints something ?
BR Klaus
Re: PrinterLib 1.10
Posted: Tue Jul 19, 2011 10:50 pm
by akee
The preview is also blank. What I am looking for is to print a list of strings with crlf and then end the document. I'm using FX W3119 laser printer.
Re: PrinterLib 1.10
Posted: Wed Jul 20, 2011 7:51 am
by ABBKlaus
have you tried some debug output ? It´s possible that there is an error opening the printer or starting the document.
For the Xerox printer i can´t find any information on the web, can you send me a link or the driver via mail ?
BR Klaus
Re: PrinterLib 1.10
Posted: Wed Jul 20, 2011 8:36 am
by akee
I added some extra code... Using the macro Print_String() below works with Print_StartPrinting() and Print_StopPrinting(). Hmmm...?
Code: Select all
Macro Print_String(CONTENT)
Print_Text(t_x, t_y, CONTENT)
t_y = t_y + Print_TextHeight(CONTENT)
EndMacro
FX-W3119 details can e found here...
http://www.fujixeroxprinters.com.my/pro ... from=multi
Re: PrinterLib 1.10
Posted: Wed Jul 20, 2011 4:24 pm
by ABBKlaus
This is a GDI printer, that means you cannot sent binary commands to print plain text

Re: PrinterLib 1.10
Posted: Wed Jul 20, 2011 4:43 pm
by akee
Ok... thanks for note...

Re: PrinterLib 1.10
Posted: Thu Aug 11, 2011 7:49 am
by akee
How do you retrieve the number of copies from the Print Dialog? Thanks.

Re: PrinterLib 1.10
Posted: Thu Aug 11, 2011 6:29 pm
by ABBKlaus
with a trick :
Code: Select all
Print_PrintDlg(0)
*d.DEVMODE
*d=Print_LoadDEVMODE("")
Debug *d\dmCopies
CallDebugger