GemBox.Document supports multiple file formats with varying degree of support. The following sections explain file formats support in more detail and present other, file format specific, valuable information.
GemBox.Document supports the following file formats:
Supporting a file format as an input file format means that GemBox.Document is able to read the specified file format and supporting it as an output file format means that GemBox.Document is able to write to the specified file format.
In addition to exporting to a file or a stream, GemBox.Document also supports printing a document (DocumentModel Print method) and converting a document to the following types:
- XpsDocument using the DocumentModel ConvertToXpsDocument(XpsSaveOptions) method and
- ImageSource using the DocumentModel ConvertToImageSource(ImageSaveOptions) method.
These outputs are especially useful in WPF applications, by providing a means to embed a document in your WPF application with DocumentViewer and Image controls, as shown in our GemBox.Document Sample Explorer , in the Viewer tab.
Following code snippet shows how to assign a DocumentModel instance to DocumentViewer and Image controls:
// Assign a DocumentModel instance to DocumentViewer control. documentViewer.Document = document.ConvertToXpsDocument(SaveOptions.XpsDefault).GetFixedDocumentSequence(); // Assign a DocumentModel instance to Image control. image.Source = document.ConvertToImageSource(SaveOptions.ImageDefault);
GemBox.Document supports most of the Microsoft Word Document (DOCX) features through its API, but not all.
For example, GemBox.Document doesn't support table related styles, document revision changes, structured document and custom XML tags, comments, footnotes and endnotes through its API.
Although not supporting all Microsoft Word Document (DOCX) features through its API, GemBox.Document allows you to preserve the unsupported features, so you don't lose any relevant document content when loading and saving a document to DOCX format.
For more information, see Preservation and Preservation samples.
Exporting a document to a fixed document file format, such as PDF and XPS, and to image formats is accomplished with GemBox.Document internal paginator and renderer that are commonly used for all formats mentioned.
This means that PDF, XPS and image formats share the same level of support for document features, since they are all rendered in the same way.
The following list contains GemBox.Document API members that are, currently, not supported when exporting to PDF, XPS and image formats:
- ViewOptions class.
CharacterFormat properties:
- ParagraphFormat RightToLeft property.
ListLevelFormat properties:
- Alignment,
- CharacterFormat (except FontName),
- TrailingCharacter.
TableCellFormat properties:
TableRowFormat properties:
TableFormat properties:
Picture properties:
- PageSetup TextColumns property.
- BorderStyle fields Double, Triple, Wave and DoubleWave.
- UnderlineType fields Wave and DoubleWave.
- TabStopAlignment fields Bar and List.
- SectionStart Continuous field.
| Support for these members will be added in future versions of GemBox.Document based on customer feedback. |
Most of the Internet Service Providers restrict hosted ASP.NET applications to Medium Level Trust and by doing so, disable accessing files outside the application directory, among other things, as explained in trust Element (ASP.NET Settings Schema) level Attribute.
GemBox.Document support for Partially Trusted applications depends on the used file formats as follows:
- Microsoft Word Document (DOCX) is fully supported in Partially Trusted applications.
Adobe Portable Document Format (PDF) is supported in Partially Trusted applications if the document doesn't contain any image (reasons explained in below Image formats support bullet) and if font location is set to a directory that is available to the Partially Trusted application.
ImportantSetting the font location directory is necessary for Partially Trusted applications because they can only access files inside the application directory, and font files are, by default, located in C:\Windows\Fonts, which is restricted to Partially Trusted applications.
For more information on how to set font location directory, see Private Fonts sample.
Font files are, usually, copyrighted, so make sure you conform to the font license, before copying a font file to another location.
- Microsoft XMP Paper Specification (XPS) is not supported in Partially Trusted applications because ReachFramework.dll assembly, where most of the XPS implementation resides, is not decorated with AllowPartiallyTrustedCallersAttribute.
- Image formats (BMP, GIF, JPEG, PNG, TIFF, WMP) are not supported in Partially Trusted applications because BitmapEncoder class and its derived classes, used for writing image data to the specific image file format, do not work in partial trust.
- Printing is not supported in Partially Trusted applications because it uses XPS infrastructure.