
PrinterLib 1.10
Re: PrinterLib 1.10
Thanks ABBKlaus... 

Re: PrinterLib 1.10
If you have 8 pages in a print out and you only want to print page 3-5, how do you use Print_PrintDlg() to get this done. I noticed a procedure Print_SetPRINTDLG(). The documentation is too little to understand. Thanks. 

Re: PrinterLib 1.10
Using Print_PrintDlg :
BR Klaus
Code: Select all
Print_PrintDlg(0,"","","FLAGS=2,NFROMPAGE=2,NTOPAGE=3,NMAXPAGE=999")
Re: PrinterLib 1.10
Hi,
How can get the name of the printer that was selected in Print_PrintDlg(0)
Thank you
How can get the name of the printer that was selected in Print_PrintDlg(0)
Thank you
Re: PrinterLib 1.10
Try Print_GetPrinterName()
Re: PrinterLib 1.10
Thank you.
Great Lib!
Great Lib!

-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
Similar question but I can't find a structure that holds the value - how do you get the page range from the Printer Dialog? Setting it initially is easy via the Print_PrintDlg options, but if the document is 8 pages and the User opts to print pages 3 to 6 on the dialog, how do we know?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
...Still trying to get print spooling to work. If I try:
...I get an IMA: [Error]Invalid memory access (write error at address 0)
If I try Print_StartDoc(sJobName) only, I get a job of zero bytes in the printer queue and my app is frozen.
I'm sure this is all because there are specific ways/sequences in order to use the functions properly, but the example files do not cover spooling.
Code: Select all
Print_StartPrinting(sJobName)
Print_StartDoc(sJobName)
If I try Print_StartDoc(sJobName) only, I get a job of zero bytes in the printer queue and my app is frozen.
I'm sure this is all because there are specific ways/sequences in order to use the functions properly, but the example files do not cover spooling.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PrinterLib 1.10
Hi IdeasVacuum,
PrinterLib :
Sample :
Why the ima occurs i have no idea (no ima here, but your example is quiet incomplete), the freeze might be due to the printer not beeing online.
I had similar experience with freezes when printers where offline not only with this lib (MS Excel ...) but its only my best guess.
Hope that helps
BR Klaus
there is a global variable not wrapped to the outside its called PrintLibDLG.PRINTDLG, you could use the following to get the values back :Similar question but I can't find a structure that holds the value - how do you get the page range from the Printer Dialog? Setting it initially is easy via the Print_PrintDlg options, but if the document is 8 pages and the User opts to print pages 3 to 6 on the dialog, how do we know?
PrinterLib :
Code: Select all
ProcedureDLL.l Print_GetPrintDlg()
ProcedureReturn PrintLibDLG
EndProcedure
Code: Select all
Print_PrintDlg(0,"","","FLAGS=2,NFROMPAGE=2,NTOPAGE=3,NMAXPAGE=999")
*Test.PRINTDLG=Print_GetPrintDlg()
Debug *Test\nFromPage
Debug *Test\nToPage
*d.DEVMODE
*d=Print_LoadDEVMODE("")
Debug *d\dmCopies
CallDebugger
The JobID comes with the call to Print_StartPrinting(), Print_StartDoc() is used only for Binary printing.IdeasVacuum wrote:...Still trying to get print spooling to work. If I try:
...I get an IMA: [Error]Invalid memory access (write error at address 0)Code: Select all
Print_StartPrinting(sJobName) Print_StartDoc(sJobName)
If I try Print_StartDoc(sJobName) only, I get a job of zero bytes in the printer queue and my app is frozen.
I'm sure this is all because there are specific ways/sequences in order to use the functions properly, but the example files do not cover spooling.
Why the ima occurs i have no idea (no ima here, but your example is quiet incomplete), the freeze might be due to the printer not beeing online.
I had similar experience with freezes when printers where offline not only with this lib (MS Excel ...) but its only my best guess.
Hope that helps
BR Klaus
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
Hi ABBKlaus, thanks for helping me.
Unfortunately the line Debug *Test\nFromPage Halts execution with [Error] Pointer is null.
Unfortunately the line Debug *Test\nFromPage Halts execution with [Error] Pointer is null.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PrinterLib 1.10
Have you TailBiten the PrinterLib with the command Print_GetPrintDlg() ?
I guess you have only added it to the top of your code, this won't work
You can also redownload the lib, i have the command already added.
BR Klaus
I guess you have only added it to the top of your code, this won't work

You can also redownload the lib, i have the command already added.
BR Klaus
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
Ah thanks ABBKlaus - I created a DLL and called that
In terms of actually printing something, it works very well on a physical printer but the pages are blank if printing to a virtual pdf engine (CutePDF, PDF995).
...using images because the app is 'filling in' scanned forms.

In terms of actually printing something, it works very well on a physical printer but the pages are blank if printing to a virtual pdf engine (CutePDF, PDF995).
Code: Select all
sOpt1.s = "ORIENTATION=" + Str(#DMORIENT_PORTRAIT) + Chr(44) + "PAPERSIZE=" + Str(#DMPAPER_A4) + Chr(44) + "PAPERLENGTH=297" + Chr(44) + "PAPERWIDTH=210" + Chr(44) + "SCALE=1" + Chr(44) + "COPIES=1" + Chr(44) + "DEFAULTSOURCE=" + Str(#DMBIN_AUTO) + Chr(44) + "PRINTQUALITY=" + Str(#DMRES_HIGH) + Chr(44) + "COLOR=" + Str(#DMCOLOR_COLOR) + Chr(44) + "COLLATE=" + Str(#DMCOLLATE_TRUE)
sOpt2.s = "FLAGS=" + "NFROMPAGE=1" + Chr(44) + "NTOPAGE=" + Str(igPageCnt) + Chr(44) + "NMINPAGE=1" + Chr(44) + "NMAXPAGE=999" + Chr(44) + "NCOPIES=1"
sJobName.s = "PP_" + Str(Date())
If Print_PrintDlg(#WinMain,Print_GetDefaultPrinter(),sOpt1,sOpt2)
;*PrintInfo.PRINTDLG = Print_GetPrintDlg()
;Debug *PrintInfo\nFromPage
;Debug *PrintInfo\nToPage
Print_OpenPrinter(Print_GetPrinterName())
Print_SetUnits(#PRINT_MM)
Print_StartPrinting(sJobName)
Print_Image(igPP01,0,0,210,297)
Print_NewPage()
Print_Image(igPP02,0,0,210,297)
Print_NewPage()
Print_Image(igPP03,0,0,210,297)
Print_NewPage()
Print_Image(igPP04,0,0,210,297)
Print_StopPrinting()
EndIf
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PrinterLib 1.10
Do you have those images somewhere for download ?
Might be the imagesize that does not fit
Might be the imagesize that does not fit

-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
...not sure, given that it does actually print perfectly to a physical printer, but do you think it has something to do with PDF, i.e. the image size cannot be exactly the same as PDF page size (A4, 210x297mm)? I'm going to experiment with the image size because I just discovered that the PurePDF lib also creates blank files with these images (using code that is identical to an older app that does not have this issue).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PrinterLib 1.10
.....Whoa, that is it - the images are size A4 and size A4 images do not fit on a PDF A4 page apparently! That is definitely going to be painful. I will have to work out exactly how much smaller the images need to be, I just clipped one by 10 pixels all-round for this test.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.