printer_instructions property
FieldPrint.printer_instructions property
Gets or sets the printer-specific control code characters or PostScript instructions.
@property
def printer_instructions(self) -> str:
...
@printer_instructions.setter
def printer_instructions(self, value: str):
...
Examples
Shows to insert a PRINT field.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
builder.write('My paragraph')
# The PRINT field can send instructions to the printer.
field = builder.insert_field(field_type=aw.fields.FieldType.FIELD_PRINT, update_field=True).as_field_print()
# Set the area for the printer to perform instructions over.
# In this case, it will be the paragraph that contains our PRINT field.
field.post_script_group = 'para'
# When we use a printer that supports PostScript to print our document,
# this command will turn the entire area that we specified in "field.PostScriptGroup" white.
field.printer_instructions = 'erasepage'
self.assertEqual(' PRINT erasepage \\p para', field.get_field_code())
doc.update_fields()
doc.save(file_name=ARTIFACTS_DIR + 'Field.PRINT.docx')
See Also
- module aspose.words.fields
- class FieldPrint