Raildex
Raildex

Reputation: 4727

Printing long receipt pdf to fit on receipt paper

I want to print a very long PDF with a receipt printer (Epson TM-T88IV). The PDF I want to print however is predefined (I cannot change how the file is produced).

When I want to print this PDF with the Receipt printer, it prints it very very small and the receipt is unreadable.

There is a large margin left and right. To me, it looks like the Receipt printer wants to print the PDF onto a very small area.

if (type == PRINTER_TYPE.RECEIPT)
        {
            settings.DefaultPageSettings.Landscape = false;
            settings.DefaultPageSettings.PaperSize = (new PaperSize("Roll Paper",(int)(80*0.254), (int)(297 * 0.254))); //PaperSize is taken from the Printer Settings multiplied with a hundreth of an inch
        }

I couldn't find anything related.

€dit:

After some testing and printing multiple documents. I found out that the PDF Documents that print correctly have a correct Size

This one prints correctly, everything can be read when printed:

This one prints correctly, everything can be read when printed

This one cannot, as it is only one large page (What I want to print ):
enter image description here

Is it possible to ignore the height and let the printer print the whole page correctly?

Upvotes: 1

Views: 3411

Answers (2)

Bartosz Pachołek
Bartosz Pachołek

Reputation: 1308

You have probably solved the case yourself within last 6 years, but if not: I have created a small C# library which allows you generate such PDFs. Maybe useful for you: https://github.com/ideaconnect/pos-printer-pdf-generator

Upvotes: 0

Rob Lyman
Rob Lyman

Reputation: 364

PDF pages have a fixed size, both width and height. The receipt printer is most likely shrinking the page down while preserving the aspect ratio to fit it onto the paper.

Without a way to change the PDF itself, including the layout, I'm afraid you won't be able to fit it in a legible way on to the printer.

Upvotes: 1

Related Questions