Home General

Printing receipts of various lengths on POS printers

edited January 2016 in General
Hi,

due to implementation of fiscal cash registers in our country and of
course different types of POS printers, we have changed printing to POS
printers from direct printing with ESC/POS to ReportBuilder. We
followed the guidelines published on website and here and mainly the
printing does not present any problems except on few printers. The
invoices have different lenghts, sometimes they can be only 15 cm long,
sometimes more than 30 cm and this presents an issue with some printers
like STAR TSP 100, Custom Q1... No problems on Epson TM-88 and Start
TSP 143 for example.

Since a customer sent us Custom Q1 which has the dumbest driver I made
some test to observe what is going on. Let's say I have set the report
length to 20 cm. If the report is less than 20 cm, then it prints
receipt 20 cm long receipt and then it cuts the paper no matter if
there is only 15cm or exactly 20 cm of stuff to be printer. If there is
more than to print, then it produces some empty space then continues
the printing. I set the top/bottom margins to 0 mm, nothing. There is
no option in the driver to set this either, only the width of paper
roll.

The next problem occured today with STAR TSP-100 printer which not only
produces empty space but even cuts the receipt.

From ESC/POS sequences I know there is information about the document
length and page length. Looks like that the page length is sent to the
POS printers somehow and the driver does the funny stuff there.

I don't know how to trick those printers, maybe dynamically calculate
the report length and then adjust page lenght? Are there any other
possibilities? I can send You such report to You on an e-mail for
inspection...

We use ReportBuilder 16.03 and the update to newer version is not
planned.

Many thanks in advance and best regards,
Goran Brumen
Audax d.o.o.

Comments

  • edited January 2016
    Hi Goran,

    The Report.OnPrinterDeviceStateChange event can be used to send escape code
    directly to the printer. For details check out the RBuilder Help topic for
    TppProducer OnPrinterDeviceStateChange event. There is a code sample there
    also.

    What ReportBuilder does is apply the Report.PrinterSetup properties to the
    printer via the Windows API DevMode structure. Then to print documents, RB
    uses Win API BeginDoc/EndDoc to start/end a print job and StartPage/EndPage
    to generate each page.


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2016
    Hi Nard,

    thank You for the answer but I am unsure how to use this information?

    After all printing in graphic mode is not a problem, the looks is
    mostly okay except on few printers that either insert some blank space
    in between or at the end, either they cut the receipts at these points.

    Is there a trick to dynamically calculate lenghth of the paper needed
    so before printing starts, the proper page size is sent (i.e if receipt
    is 15 cm long, then page lenght=15cm, if 40cm long then page length =
    40cm)?

    Best regards,
    Goran

  • edited January 2016
    Hi Goran,

    To calculate the length required you could perhaps write some pre-processing
    code to iterate over the dataset and calculate the number detail lines.

    This rbWiki article discusses some strategies for printing to continuous
    paper. On approach is to set the paper length to be very small - the height
    of a detail band perhaps.

    http://www.digital-metaphors.com/rbWiki/Output/Printer/Continuous_Paper






    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2016
    Hi Nard,

    thank You for the link, will try to do something with this information.

    The approach to set the page size smaller than the actual receipt
    length is wrong for some POS printers. Just a while ago I have received
    a photo from a customer where the receipt has been cut off just after
    the details were printed and then the receipt continues. I guess the
    cut was made at the preset page length while the actual receipt is a
    bit longer. So actually I need to set the paper length at least the
    same length as the receipt length or a bit more. Unfortunatelly I do
    not know which POS printer they use.

    Thank You very much and best regards,
    Goran Brumen
    Audax d.o.o.


This discussion has been closed.