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:18PM
    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:18PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.