TX Text Control ActiveX

PDF Export

Topic

The Portable Document Format (PDF) exists mainly to exchange documents between systems without changing their formatting: a PDF document keeps its formatting and layout when it is printed or displayed on different machines or operating systems. TX Text Control ActiveX exports documents of all the formats it supports to PDF and to PDF/A, the PDF standard for archiving.

Exporting takes one call of the Save method, and a PDF/A file needs two properties set before it. The sections below cover both, and how fonts are handled when a PDF/A file has to embed them.

Choose a PDF Version

TX Text Control saves a document in one of two PDF versions:

  • Standard PDF version 1.3, compatible with Acrobat 4.x and higher.
  • PDF/A-1b, an ISO standard.

What PDF/A Is

PDF/A is a format created for the long-term archiving of electronic documents:

  • A PDF/A file is 100% self-contained. All information that is necessary to display its content must be embedded in the file.
  • Some content is forbidden. Audio and video content, JavaScript and any other executable code aren't allowed, and neither is encryption.
  • It is an ISO standard. PDF/A is based on the PDF Reference Version 1.4 of Adobe Systems Inc. and was published as an ISO standard on October 1, 2005.

The PDF filter of TX Text Control exports documents to PDF/A-1b, so that you can archive documents in compliance with ISO standards.

Save a Document as PDF/A

To export any content of a TXTextControl to a PDF/A-1b file, call the Save method with the format value 14, Adobe Portable Document Format Archive (PDF/A). The format value 12 saves a standard PDF file, Adobe Portable Document Format (PDF). For both formats, the method's CurSelection parameter must be False.

To export the page size of the document to PDF, the ViewMode property must be set to 2, Page View.

The basic steps to create a PDF/A document in an application are:

  1. Set the ViewMode property to 2.
  2. Set the FontSettings property of the TXTextControl to 2, embeddable fonts only.
  3. Save the document with the Save method and the format value 14.

Restrict Fonts to Embeddable Ones

The FontSettings property restricts which fonts a document can use. This matters for PDF/A, because not every font can be embedded in a PDF/A file, for one of two reasons:

  • the license of the font forbids embedding, or
  • the font is device dependent.

TX Text Control includes an algorithm that replaces any font that cannot be embedded.