Docxpresso is internally based on the Open Document Format so it generates natively .odt files. Nevertheless as one could imagine because its name that is not its main or, at least, only purpose.

Docxpresso is able to generate documentation in the following formats:

  • PDF or Portable Document Format (and their accessible counterparts).
  • Word documents (in .doc and docx. formats).
  • Open Document Format (.odt) that is the native format of, for example, Open Office and Libre Office.
  • RTF or Rich Text Format.

With practically any source of data: hard coded text, html files or source code, databases, spreadsheets, etcetera.

Let us elaborate on all of this in a little more detail.

PDF documents

PDF is the preferred format for the distribution of electronic documents because:

  • It is (almost) universally supported.
  • It can not be easily modified (of course, this is not always a desirable characteristic),
    although this is less true nowadays with the appearance of new and powerful pdf editor tools.

The PDF generation uses the most up to date versions of the Libre Office (preferred) or Open Office PDF engines to create the PDF file out of the native ODF format.

This choice allows us to benefit from a wealth of options that include:

General Options


You can check directly the documentation and some working samples in our tutorial:
PDF rendering options

  • PageRange (type: string), if left empty all pages are printed. If a range is given, e.g. 2-4, only those pages are exported to PDF.
  • UseLosslessCompression (type: bool, default: false), if true all images are exported as PNG, otherwise the JPG format is used.
  • Quality (type: int, default: 90)), this option sets the quality of JPG export (it has to be a value between 1 and 100).
  • ReduceImageResolution (type: bool, default: false), if true will use the resolution specified by the MaxImageResolution property.
  • MaxImageResolution (type: int, default: 300) sets the dpi (dots per inch) resolution of the exported images.
  • SelectPdfVersion (type: int, default: 0):
    • PDF 1.4: set this option to 0 (default).
    • PDF/A-1 (ISO 19005-1:2005): set this option to 1.
  • UseTaggedPDF (type: bool, default: false), if set to true it creates a tagged (accesible) PDF.
  • ExportFormFields (type: bool, default: true), if true all form elements are exported as such.
  • FormsType (type: int, default: 2) specifies the submit format of the PDF forms:
    • FDF: set this option to 0.
    • PDF: set this option to 1.
    • HTML: set this option to 2 (default value).
    • XML: set this option to 3.
  • ExportBookmarks (type: bool, default: true)), if true exports to PDF the document bookmarks.
  • EmbedStandardFonts (type: bool, default: false), if true the 14 standard PDF fonts are included into the PDF file.
  • Watermark (type: string), if not emty watermarks the PDF with the given text.

Initial view

  • InitialView (type: int, default: 0) specifies how the PDF should be displayed when opened:
    • 0: default view mode, neither outlines or thumbnails.
    • 1: outline pane opened.
    • 2: thumbnail pane opened.
  • Magnification (type: int, default: 0) specifies the magnification of the PDF when opened:
    • 0: default magnification.
    • 1: fit entire page within the viewer window.
    • 2: fit entire page width within the viewer window.
    • 3: fit entire page width (cutting the margins) within the viewer window.
    • 4: opens with the zoom specified in the Zoom option.
  • Zoom (type: int, default: 100) specifies the zoom level (only used if Magnification is set to 4). The available range is 50-1600.
  • PageLayout (type: int, default: 0) specifies the PDF layout when opened:
    • 0: default viewer configuration.
    • 1: one page at a time.
    • 2: display pages in one column.
    • 3: display pages in two columns.
  • FirstPageOnLeft (type: bool, default: false), if true the first page should be on the left (only used if PageLayout is set to 3).

User interface

  • CenterWindow (type: bool, default: false), if true the PDF viewer window is centred in the screen.
  • OpenInFullScreenMode (type: bool, default: false), if true the PDF is open in full screen mode.
  • DisplayPDFDocumentTitle (type: bool, default: true), if true the title of the PDF (if previously set) is shown in the viewer window title bar.
  • HideViewerMenubar (type: bool, default: false), if true hides the viewer menubar.
  • HideViewerToolbar (type: bool, default: false,) if true hides the viewer toolbar.
  • HideViewerWindowControls (type: bool, default: false), if true hides the viewer controls.

Security

  • EncryptFile (type: bool, default: false), if true the PDF is encrypted and to be opened the use has to introduce the password set with the help of the DocumentOpenPassword option.
  • DocumentOpenPassword (type: string) specifies the password to be used to open the PDF file if the option EncryptFile is set to true.
  • RestrictPermissions (type: bool, default: false) if true some permissions are password protected.
  • PermissionPassword (type: string) specifies the password to be used to access the restricted functionalities.
  • Printing (type: int, default: 2) specifies the printing configuration:
    • 0: the document can not be printed.
    • 1: the document can only be printed in low resolution.
    • 2: the document can be printed with no restrictions.
  • Changes (type: int, default: 4) specifies which changes are allowed:
    • 0: protected against any change.
    • 1: pages can be added, deleted or rotated.
    • 2: filling forms.
    • 3: filling forms and adding comments.
    • 4: all changes are allowed but page extraction.
  • EnableCopyingOfContent (type: bool, default: true), if true the content can be copied and pasted elsewhere.

Open Document Format

This is the native format used by Docxpresso so it is the fastest to render.

The generated .odt files can be directly open by Libre Office, Open Office and MS Office 2010 or higher.

Like in the PDF case you may encript your files using the following options:

  • EncryptFile (type: bool, default: false), if true the .odt file is encrypted and to be opened the use has to introduce the password set with the help of the DocumentOpenPassword option.
  • DocumentOpenPassword (type: string) specifies the password to be used to open the encrypted file if the option DocumentOpenPassword is set to true.

MS Word

Docxpresso allows to create Word documents in two different formats:

.doc

By default, the .doc output is really Open Document Format on disguise.

Since MS Office 2007 SP2 Word interprets Open Document Format .odt files directly without the need of any further conversion. This has the advantage that the rendering of Docxpresso of this type of documents is extremely fast because it uses its native standard. The disadvantage is that the final user needs of a reasonably recent version of Word (Word 2010 or higher recommended).

If the legacy option flag is set to true, Docxpresso will convert the document to Word 97/2000/XP/2003 .doc format. Beware that some of the formatting may be lost.

.docx

You can also choose to render your document as a .docx file compatible with MS Word 2007 or higher.

You should use LibreOffice as conversion engine for .docx output. OpenOffice do not support that output format.

Some Word peculiarities

Word “Box model”

The way that recent versions of Word handle margin and padding for paragraphs should be taken into account when determining the CSS like padding and margin styles properties of Docxpresso.

Recent versions of Word (after 2007) will add the left and right padding to the dimensions of the paragraph “invading” the margins of the document page if necessary, i.e. when the paragraph left and/or right margins are smaller than the corresponding paddings.

This behaviour is different that the one used for PDF generation so it should be taken into account when the target document format is .doc (compatible with Word 2007 onwards).

If you use the legacy option you may safely ignore this observation regarding paragraph paddings and margins.

Paragraph backgrounds

Whenever you want to insert a paragraph element within another element with coloured background (table cell, textbox, …) we recommend to set the background of the paragraph to the same colour because otherwise .docx rendering may show a nasty and unwanted paragraph white background.

Rich Text Format

RTF was originally developed by Microsoft as an open exchange format for its MS Word files.

We would recommend to use RTF output only for simple documents and just in case there is a need to do so.

You may experience some loose of format whenever you choose .rtf as your output format.

We strongly recommend to use Open Office rather than Libre Office as conversion engine whenever you choose .rtf as your target output format.