PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Printing to dot matrix printers directly with print preview?
Printing to dot matrix printers directly with print preview?
Iniciado por guest, 12,feb. 2016 11:04 - 2 respuestas
Publicado el 12,febrero 2016 - 11:04
Hi,

we use to print to dot matrix printers directly (ESC/P2 codes) from some programs, because of speed and because there's a requirement to have a carbon copy. (process: customer receives goods, signs and puts their comments, new orders, corrections on the delivery note - all of it prints through to the copy! Then the copy of the delivery note is removed and brought back to the home office).

Printing by Windows driver to the dot matrix printer is much too slow. One of our customers has to print 750 delivery notes daily which actually takes 3,5 hours to print on a very fast dot matrix printer (Tally). By using the Windows driver and a tricky choice of the fonts we can come down to 7 hours for printing, but no minute less!

Now, things would be fine, but there's a new requirement to have a preview and producing a .PDF copy of delivery notes. Has any of you done this before? Any hints? Thank you!
Publicado el 12,febrero 2016 - 12:48
Hi Guenter,

I haven't tried, but I do have an idea:

1. First, you print in preview mode but with a pdf destination. To increase speed on that part, you may try to use a generic/text print driver
2. when, you return to your code from the preview, you test if the print was requested by the user. If yes, then you run your regular print on the matrix printer.

If doing the data access twice is too slow, you can do it once first, then have your two report work from the same data source (or window table)

Hope this helps

Best regards
Publicado el 13,febrero 2016 - 17:57
Hi Fabrice, thank you for your input!

Currently, the delivery notes are printed by a stream of text mixed with ESC/P2 control characters to a Generic/Text port as it is the way to have a fast printout on dot matrix printers. There are about 150 possible variations of a delivery note. Sure, no customer will ever use all of these, however, there's no way to use a report.

The idea to print the delivery notes twice (once in ESC/P2 and once using iPrint-commands with font Lucida Console => PDF) seems to be hard work (naturally, I wanted to avoid that) but looks/smells to me like the only viable solution! After printing each of the documents, the PDF document is stored together with the ESC/P2-characters used for printing in a database. When a review of an actually printed document is necvessary, a custom-made PDF-Viewer will show the PDF and clicking a "Print" button will feed the stored ESC/P2-characters to the Generic printer port again.

Thank you !