facebooktwittermenuarrow-up

GemBox Support Forum

Print PDF on Epson Thermal Printer

I am trying to generate an XPS document to print to an Epson Thermal Printer - EPSON TM-T88IV ReceiptE4

The paper types available are:

A4 210 x 297 mm
LT 8.5 x 11 in
Postcard 100 x 148 mm
Roll Paper 80 x 297 mm

Under PageSetup, A4 is available. Whether I print TXT or PDF, the text is really small as though it is assuming 8 1/2 by 11 and shrinking.

I also tried to directly print with Document.Print(printerName). The TXT file actually prints better, but the PDF is gibberish.

var document = DocumentModel.Load(fileToConvert);

foreach (var section in document.Sections)
{
    var pageSetup = section.PageSetup;
    pageSetup.Orientation = Orientation.Portrait;
    pageSetup.PaperType = PaperType.A4;
}

document.Save(fileToOutput);  // Output to XPS extension

Hi Peter,

First, note that GemBox.Document is not intended for printing PDF files, please read the Support level for reading PDF format (beta) section.

Instead, you should try using GemBox.Pdf, see its Print example.

Last regarding the TXT files, you could increase the default text size using the following:

// Increase the font size from default 11 to 18 points.
document.DefaultCharacterFormat.Size = 18;

I hope this helps.

Regards,
Mario

Thanks for the reference to the right nuget package.

The PDF prints very small. I think it is the pageSetup within the PDF itself.

You tried using GemBox.Pdf?
Can you send us your PDF so that we can take a look at it?