|
| [WD20] Printing to a USB (Epson) receipt printer |
| Iniciado por guest, 01,mar. 2016 13:24 - 8 respuestas |
| |
| | | |
|
| |
| Publicado el 01,marzo 2016 - 13:24 |
Hi guys,
I'm trying to print to a thermal USB (Epson compatible printer) receipt printer using Windows drivers. This printer is set as the default printer in Windows on a test PC. My problem is that using iPrint in GO (test) mode works perfectly with a line of code like: iPrint(iFont(glocaliBodyBold) + Upper(glocalsPrintLine)) (Note: I've used iCreateFont before the iPrint)
However, when the application is built and installed onto the same test PC and run as it would be on the customer site, the receipt prints as a very (very) small bitmap on the receipt printer.
For obvious reasons, I don't want to use the iConfigure function as I don't want the user to have to select the printer every time they want to print a receipt, and I'm pretty sure this is because I'm not using iParameter before the print.
Q: It's not clear in the Help system what iParameter settings to use; does anyone use iPrint in similar circumstances and have a set of iParameters.
I looked at using PrinterType, but according to the Help, this is only available in WDM :confused:
Thanks in advance... |
| |
| |
| | | |
|
| | |
| |
| Publicado el 01,marzo 2016 - 20:24 |
Hi Darren
You can "load" the iConfigure command with the name of a predefined printer name, preferably from a field in a local parameter file, like:
iConfigure(PARAMS.ReceiptPrinter)
I have also made a printer selection window where the user can select the printer from those installed in his system.
Best regards Ola |
| |
| |
| | | |
|
| | |
| |
| Publicado el 01,marzo 2016 - 21:11 |
Hi,
Thanks Olay, I'll try it, but doesn't iConfigure always open the printer selection dialog? I don't want to have the user selecting the printer every time a receipt is printed. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 01,marzo 2016 - 21:31 |
Darren,
iConfigure opens the printer selection window only if it has no parameter. But if given the name of an installed printer as the first parameter, it just uses the given printer and does not disturb the user,
See http://help.windev.com/en-US/…
Best regards Ola |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,marzo 2016 - 00:56 |
Ola,
Hmmm, something strange is going on... is your printer installed locally or on the server?
My printer is installed on the local PC. I added iConfigure to code as you suggested but doesn't seem to have made any difference when tested. In GO (test) mode it works fine; prints the logo at the top of the receipt, headings, product lines, totals etc... When the application is installed on the same PC but in HFCS mode (connected to the M$ server using the M$ connector), the print is not as expected. The receipt seems to be printed as a very (very) small "bitmap" version about 2cm square. If I then run in GO mode again it's fine :confused:
It's as though it's not picking up the printer settings or using the installed driver. I'm at a bit of a loss to know what I need to do in HFCS mode to make the printer work in the same way as the GO mode :confused: |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,marzo 2016 - 11:20 |
Ok, I made a temp change so that iConfigure pops-up the dialog and asks for the printer.
The GO mode still works as expected, and the (live) installed version of the application pops-up the dialog and defaults to the correct POS printer, but when OK'd, it still insists on printing incorrectly as described above.
Well... I'm at a loss to know how to make the "live" version print to this local USB receipt printer! :confused:
Clutching at straws now, but is it perhaps looking to the M$ server for the driver? ...or, is there anything I need to include in the setup.exe (WDInst) so that the installed version can associate itself with the printer?
I suppose I could run a test via the "standard" Preview window?
Oh, I also tried a test using iDestination(iPDF...) to send the receipt to a PDF file and the output (apart from it defaulting to an A4 document instead of 80mm wide) works ok.
Anyone have any experience in this area or any ideas as to what I might be missing??? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,marzo 2016 - 11:40 |
Darren,
the difference between GO and normal running is strange. I can't explain that. iConfigure() just select the required printer, which isn't really necessary if the printer is already the default in Windows. I use iInfoPrinter() to see if a change is needed and only then use iConfigure() (it's been some time ago but I thought it might save some milliseconds, which is important in POS environments)
It looks like some papersize issue. The print is resized for some reason. Can you try to set the papersize in the driver? It may be necesary to restart your program after that, to be sure it picks up the new settings. Do you get the same effect with a test-program, doing just the minimal required (ie no database, just a window with a testbutton). |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,marzo 2016 - 22:03 |
Hi Darren,
I have a "DYMO LabelWriter 450 Twin Turbo" installed in my working environment, and I use it for both labels, and occasionally also for receipts, when necessary. It is installed locally in the "shop" computer.
Whenever I want to print labels or receipts, I use iConfigure(PARAMS.ReceiptPrinter) before printing, where PARAMS.ReceiptPrinter = "DYMO LabelWriter 450 Twin Turbo"
Have you specified the paper size in your report procedure, like:
iParameter(iOrientation, iOrientation_Portrait) iParameter(iPaperLength, 1010) iParameter(iPaperWidth, 540)
I don't have this printer now in my development environment, so can't test in the testmode, but in exe-mode this works beautifully.
Best regards Ola |
| |
| |
| | | |
|
| | |
| |
| Publicado el 02,marzo 2016 - 22:21 |
Hi guys,
Done some more testing ...
I used iInfoPrinter and it returns the correct current and default printer name. Now, something a little strange is when I ask for the driver name it returns 'winspool' but I expected something like 'POS80 10.0.0.1' :confused: I was under the impression that winspool is the standard Windows driver?
No, I haven't tried setting the paper size directly, it's set in the properties correctly, but I'm getting to the point where I'll try anything!
I also thought that it might be something to do with the registry due to the 'winspool' being returned.
...and I still need to quickly put together a simplified print test as suggested by Arie. |
| |
| |
| | | |
|
| | | | |
| | |
|