FieldPrintPrinterInstructions Property

Gets or sets the printer-specific control code characters or PostScript instructions.

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public string PrinterInstructions { get; set; }

Property Value

Type: String
Examples
Shows to insert a PRINT field.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("My paragraph");

// The PRINT field can send instructions to the printer that we use to print our document
FieldPrint field = (FieldPrint)builder.InsertField(FieldType.FieldPrint, true);

// Set the area for the printer to perform instructions over
// In this case it will be the paragraph that contains our PRINT field
field.PostScriptGroup = "para";

// When our document is printed using a printer that supports PostScript,
// this command will turn the entire area that we specified in field.PostScriptGroup white 
field.PrinterInstructions = "erasepage";

Assert.AreEqual(" PRINT  erasepage \\p para", field.GetFieldCode());

builder.InsertParagraph();

// PRINTDATE field will display "0/0/0000" by default
// When a document is printed by a printer or printed as a PDF (but not exported as PDF),
// these fields will display the date/time of the printing operation, in various calendars
FieldPrintDate fieldPrintDate = (FieldPrintDate)builder.InsertField(FieldType.FieldPrintDate, true);
fieldPrintDate.UseLunarCalendar = true;
builder.Writeln();

Assert.AreEqual(" PRINTDATE  \\h", fieldPrintDate.GetFieldCode());

fieldPrintDate = (FieldPrintDate)builder.InsertField(FieldType.FieldPrintDate, true);
fieldPrintDate.UseSakaEraCalendar = true;
builder.Writeln();

Assert.AreEqual(" PRINTDATE  \\s", fieldPrintDate.GetFieldCode());

fieldPrintDate = (FieldPrintDate)builder.InsertField(FieldType.FieldPrintDate, true);
fieldPrintDate.UseUmAlQuraCalendar = true;
builder.Writeln();

Assert.AreEqual(" PRINTDATE  \\u", fieldPrintDate.GetFieldCode());

doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.PRINT.PRINTDATE.docx");
See Also