Issue with dot matrix printer

Hello,

I'm having an issue in one of my reports. If I print it in a laser printer it works correctly, but when I print it in a dot matrix printer, it looks like the font looses its spacing and looks compressed. Also if the font is a bit large, it appears cut at the bottom.

I'm using a monospacing font, the Courier.

I'm attaching a scan of the report to show what is happening.

Any idea about how can I solve it? Thanks

Comments

  • You can use Matrix print:

    In the Preview window press Save -> Print -> Text File/Matrix Printer...

  • That could help, but is there an option to do that directly without having to use the preview window? Thanks.

  • You can use FastReport.Export.Text.TextExport in your programm code.

  • Thanks.

    I know that with matrix printing there are limitations, but I noticed that the columns in my report got compressed, making the alignment of the fields "obsolete". I aligned the right columns, to the right with two decimals, so they looked aligned by its comma and as a text file I don't get that effect.

    I see that modifying the scale X, the space between the columns increase and when it gets to a specific value the commas get aligned. Is there something that need to be done in the designer? Like using an specific font size and no more than X character per field? Or how can I know the optimal scale for the printer.

    Also, the report use bold characters in the header, and a different font with a bigger size at the end for the total, but when exporting it to text those differences get lost. Is is possible to use different styles or font when using matrix printing?

  • Hello!

    Dot matrix printing without a preview from the code:

    report.Prepare();
    using var txtExport = new FastReport.Export.Text.TextExport
    {
    ScaleX = 1.0f,
    ScaleY = 1.0f,
    Frames = false,
    EmptyLines = false
    };
    txtExport.Export(report, outFilePath); // and sending to the printer’s raw port / RawPrinterHelper
    

    TextExport lays out objects on a character grid (fixed number of columns/rows). Choose a layout grid so that the field width is a multiple of the printer’s character pitch (for example, 10 CPI = 80 characters per line), and adjust ScaleX empirically to achieve the desired character density (approximately sheet_width_in_characters / width_in_pixels * pitch), avoiding fractional column offsets.

    When exporting text, GDI fonts are not printed (only the dot-matrix printer’s own ESC/P commands are used via `PrinterType` in the TextExport settings, provided the model supports ESC/P for bold/large fonts).

This discussion has been closed.