Printer_Lib
Re: Printer_Lib
So it should be Printer_Lib.res?
I changed and did not see any diference
I changed and did not see any diference
Re: Printer_Lib
Sorry. I deleted some lines before copy the code, and that line was deleted too. This is the code
But still not working. Gonna check your example
Code: Select all
Enumeration
#logo
EndEnumeration
IrsNbr.s = "000001/2013"
IRSheader.s = "Relatório de Assistência nº: " + IrsNbr.s
OPT$ = "ORIENTATION = " + Str(#DMORIENT_PORTRAIT) + ", "
OPT$ + "PAPERSIZE = " + Str(#DMPAPER_A4)
LoadImage(#logo, "AFVCR - logo IRS.png")
If Print_OpenPrinter(Print_GetDefaultPrinter(), OPT$)
Print_Image(#logo, 20, 10, 141, 67)
Print_StartPrinting(IrsNbr.s)
Print_Font("trebuchet ms", 12, #PB_Font_Bold)
Print_SetTextColor(#Black)
Print_Text(100, 10, IRSheader.s)
Print_Font("trebuchet ms", 8)
Print_Text(20, 30, IRSheader.s)
Print_Line(20, 40, 180, 0)
Print_StopPrinting()
Else
MessageRequester("", "no printer available")
EndIf
Re: Printer_Lib
No did not. It is not just on the snipet I posted. Sorry. But it is there
Code: Select all
Enumeration
#logo
EndEnumeration
IrsNbr.s = "000001/2013"
IRSheader.s = "Relatório de Assistência nº: " + IrsNbr.s
OPT$ = "ORIENTATION = " + Str(#DMORIENT_PORTRAIT) + ", "
OPT$ + "PAPERSIZE = " + Str(#DMPAPER_A4)
UsePNGImageDecoder()
LoadImage(#logo, "AFVCR - logo IRS.png")
If Print_OpenPrinter(Print_GetDefaultPrinter(), OPT$)
Print_Image(#logo, 20, 10, 141, 67)
Print_StartPrinting(IrsNbr.s)
Print_Font("trebuchet ms", 12, #PB_Font_Bold)
Print_SetTextColor(#Black)
Print_Text(100, 10, IRSheader.s)
Print_Font("trebuchet ms", 8)
Print_Text(20, 30, IRSheader.s)
Print_Line(20, 40, 180, 0)
Print_StopPrinting()
Else
MessageRequester("", "no printer available")
EndIf
Re: Printer_Lib
Please post the logfile 

-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Printer_Lib
Print_Image() should be after Print_StartPrinting(). Also note that the image size values are measured in print units, not pixels - looks like you have that right, just a rather large logo.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Printer_Lib
I don't see any log file in the source directory.
I'm sorry

I'm sorry
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Printer_Lib
Code: Select all
Enumeration
#Logo
EndEnumeration
CreateImage(#Logo,533,253,24)
If StartDrawing(ImageOutput(#Logo))
Box(0,0,533,253,RGB(056,180,074))
StopDrawing()
EndIf
sIrsNbr.s = "000001/2013"
sIRSheader.s = "Relatório de Assistência nº: " + sIrsNbr
sOPT.s = "ORIENTATION = " + Str(#DMORIENT_PORTRAIT) + ", "
sOPT + "PAPERSIZE = " + Str(#DMPAPER_A4)
;UsePNGImageDecoder()
;LoadImage(#logo, "AFVCR - logo IRS.png")
If Print_OpenPrinter(Print_GetDefaultPrinter(), sOPT)
Print_StartPrinting(sIrsNbr)
Print_Image(#Logo, 20, 10, 141, 67)
Print_Font("trebuchet ms", 12, #PB_Font_Bold)
Print_SetTextColor(#Black)
Print_Text(100, 10, sIRSheader)
Print_Font("trebuchet ms", 8)
Print_Text(20, 30, sIRSheader)
Print_Line(20, 40, 180, 0)
Print_StopPrinting()
Else
MessageRequester("", "no printer available")
EndIf
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Printer_Lib
Well spotted Ideasvacuum
Today i am ClueLess, lets continue tomorrow.

Today i am ClueLess, lets continue tomorrow.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Printer_Lib
It should be ....\Residents\Printer_Lib_Res.resSo it should be Printer_Lib.res?
Edit:
I don't see a log file either, if I use Print_SetDebug(#True) for the above code.I don't see any log file in the source directory.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Printer_Lib
Ok. we wiil continue tomorrow then if you don't mind. But how will I get the log file to be created?
@IdeasVacuum
I posted before I see your post. I'm going to create the log
Thank You
@IdeasVacuum
I posted before I see your post. I'm going to create the log
Thank You
Re: Printer_Lib
The libfile...
Code: Select all
Printer-Lib Version V1.10
PureBasic Version 520
Printer : CutePDF Writer
OpenPrinter_()=1
Print_SetTextAlign(0)
SetTextAlign_(DB211445,0)=0
Print_SetBkMode(1)
SetBkMode_(DB211445,1)=2
Print_SetLineColor(0)
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF00,0,0)=8F5008C1
Print_CreateBrush(0)
CreateSolidBrush_(0)=BA10140F
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF08,0,0)=61501AD8
ipprint_Image(0,20,10,141,67,13369376)
IsImage(0)=20379328
UseImage(0)=1627720779
GetDeviceCaps_()=#RC_BITBLT,#RC_BITMAP64,#RC_DI_BITMAP,#RC_DIBTODEV,#RC_STRETCHBLT,#RC_STRETCHDIB
ImageWidth=141
ImageHeight=67
ImageDepth=32
Using #RC_STRETCHBLT method
CreateCompatibleDC_(0)=-1878980415
SelectObject_(-1878980415,1627720779)=25493519
StretchBlt_(-618589115,472,236,3331,1583,-1878980415,0,0,141,67,13369376)=0
ipprint_Line(20,40,200,40)
LineTo_()=1
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Printer_Lib
aha, the log is not saved to the folder of the exe/project, it gets saved to the parent folder of the tree......
Printer-Lib Version V1.10
PureBasic Version 520
Windows_XP
Printer : PDF995
OpenPrinter_()=1
Print_SetTextAlign(0)
SetTextAlign_(DF21349D,0)=0
Print_SetBkMode(1)
SetBkMode_(DF21349D,1)=2
Print_SetLineColor(0)
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF34,0,0)=D8503604
Print_CreateBrush(0)
CreateSolidBrush_(0)=AF100BD7
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF3C,0,0)=435030BF
ipprint_Image(0,20,10,141,67,13369376)
IsImage(0)=10026912
UseImage(0)=168112761
GetDeviceCaps_()=#RC_BITBLT,#RC_BITMAP64,#RC_DI_BITMAP,#RC_DIBTODEV,#RC_STRETCHBLT,#RC_STRETCHDIB
ImageWidth=533
ImageHeight=253
ImageDepth=24
Using #RC_STRETCHBLT method
CreateCompatibleDC_(0)=-603900412
SelectObject_(-603900412,168112761)=25493519
StretchBlt_(-551471971,472,236,3331,1583,-603900412,0,0,533,253,13369376)=1
ipprint_Line(20,40,200,40)
LineTo_()=1
Printer-Lib Version V1.10
PureBasic Version 520
Windows_XP
Printer : PDF995
OpenPrinter_()=1
Print_SetTextAlign(0)
SetTextAlign_(DF21349D,0)=0
Print_SetBkMode(1)
SetBkMode_(DF21349D,1)=2
Print_SetLineColor(0)
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF34,0,0)=D8503604
Print_CreateBrush(0)
CreateSolidBrush_(0)=AF100BD7
Print_CreatePen(12200,0,0,0,0)
ExtCreatePen_(12200,5,13FF3C,0,0)=435030BF
ipprint_Image(0,20,10,141,67,13369376)
IsImage(0)=10026912
UseImage(0)=168112761
GetDeviceCaps_()=#RC_BITBLT,#RC_BITMAP64,#RC_DI_BITMAP,#RC_DIBTODEV,#RC_STRETCHBLT,#RC_STRETCHDIB
ImageWidth=533
ImageHeight=253
ImageDepth=24
Using #RC_STRETCHBLT method
CreateCompatibleDC_(0)=-603900412
SelectObject_(-603900412,168112761)=25493519
StretchBlt_(-551471971,472,236,3331,1583,-603900412,0,0,533,253,13369376)=1
ipprint_Line(20,40,200,40)
LineTo_()=1
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Printer_Lib
mine got saved in the source / exe folder...
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Printer_Lib
Might depend on the depth of the tree.mine got saved in the source / exe folder...
My Path to the exe: C:\PROJECTS_DrvC\AA CODE SNIPPETS\Printing\
The log file is saved to: C:\PROJECTS_DrvC\
Edit: ... looks like the Print_Lib maybe getting the path from the .pb file attributes appended.
Edit 2: Can fix that by using SetCurrentDirectory() before the Print functions.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.