TextExport with TextExportPrinterType and TextExportPrinterCommand

Hello,

after defining printer specific PrinterCommands with class TextExportPrinterCommand and registering these commands into a printer of type TextExportPrinterType, I can use this printer with class TextExport. How will the TextExport class use the printer specific commando sequences?

Actually I created a test code similar to this :
TextExportPrinterType printer = new TextExportPrinterType();
printer.Name = "CustomPrinter";

TextExportPrinterCommand cmd_bold = new TextExportPrinterCommand();
cmd_bold.Name = "bold";
cmd_bold.SequenceOn = new List<byte>(new byte[2] { 27, 18 });
cmd_bold.SequenceOff = new List<byte>(new byte[2] { 27, 18 });
printer.Commands.Add(cmd_bold);

TextExport export = new TextExport();
export.PrinterTypes.Add(printer);
export.PrinterType = 0;

Stream stream = new MemoryStream();
export.Export(this.Report, stream);

TextExportPrint.PrintStream("CustomPrinter", "test", 1, stream);


How will the TextExport use the corresponding TextExportPrinterCOmmands?



With best regards- Ulrich

Comments

  • edited 4:12PM
    The text export filter applies the command to the entire document. There is no option to apply it to some text objects. So I think it's not what you need.
  • edited 4:12PM
    AlexTZ wrote: »
    The text export filter applies the command to the entire document. There is no option to apply it to some text objects. So I think it's not what you need.

    Ok, I see. Makes it sense to assign more than one PrinterCommand? They all will send before printing the document starts?

    Can you give me an idea what for the PrinterCommand could be useful?

    Best regards - Ulrich

Leave a Comment