Removing Formats

TECH TIP: Controlling Available Print To File formats

Question: “How can I limit which file formats are displayed by the print dialog?”

Formats can be registered and unregistered via code.  Below is a list of the currently provided export devices:

TppArchiveDevice – Archive File
TppHTMLDevice – HTML File
TppXHTMLDevice – XHTML File (Server only)
TppPDFDevice – PDF
TppPDFADevice – PDF/A
TppPDFA2Device – PDF/A2
TppPDFA3Device – PDF/A3
TppPDFA3ZFDevice – PDF/A3 – ZUGFeRD
TppRTFDevice – Richtext File
TppDocDevice – MS DOC File
TppDocFormDevice – MS DOC File (with textboxes)
TppXLSReportDevice – MS Excel File (legacy format)
TppXLSDataDevice – MS Excel Data File (legacy format)
TppXLSXReportDevice – MS Excel File
TppXLSDataDevice – MS Excel Data File
TppReportTextFileDevice – Text File
TppTextFileDevice – Text Data File
TppBMPDevice – Bitmap Image
TppJPGDevice – JPEG Image
TppMetafileDevice – Metafile Image
TppGIFDevice – GIF Image
TppPNGDevice – PNG Image

Example:

uses
  ppDevice;

  {add some file formats}

  ppRegisterDevice(TppTextFileDevice);
  ppRegisterDevice(TppReportTextFileDevice);
  ppRegisterDevice(TppArchiveDevice);

  {remove some file formats}

  ppUnRegisterDevice(TppTextFileDevice);
  ppUnRegisterDevice(TppReportTextFileDevice);
  ppUnRegisterDevice(TppArchiveDevice);