The document type is auto-detected during loading, however, you can specify explicitly the type of the source WordProcessing document. Available options are: Doc, Docm, Docx, Dot, Dotm, Dotx, Rtf, Odt, Ott, Mobi, Txt
A handler called for each resource the document asks to load; it can allow the resource, skip it or supply its content. Default: null. Available since version 26.10.
Whether to skip the external resources the document references, such as linked pictures. Default: true. Content the document carries, local files inside its folder and resources that match WhitelistedResources still load.
Absolute URI prefixes, such as https://cdn.example.com/assets/, of external resources to load while SkipExternalResources is true. Since version 26.10, an entry that is not an absolute URI prefix makes the load fail with InvalidLoadOptionsException.
Note: missing fonts are substituted in this order: by font name (if FontNameSubstitutionEnabled), by FontConfig (if FontConfigSubstitutionEnabled), by FontSubstitutes (if set), by FontInfo (if FontInfoSubstitutionEnabled), and finally by DefaultFont (if set).
Hide comments
Microsoft Word provides the “Comment” feature that allows multiple authors or reviewers to discuss a document when they are not working with it simultaneously. All added comments are displayed in an area to the right of the document text. After the DOCX document with comments is converted to another format, the Comments pane is also present in a resultant document. If it’s required to hide comments in a converted document programmatically, set the CommentDisplayMode property to WordProcessingCommentDisplay.Hidden as shown in the following code sample:
Track Changes is another feature of Microsoft Word that provides a handy way to collaborate during document proofreading and review - it’s like you’re marking errors with a pen and making some notes in the margins. All changes made by coworkers are highlighted and may be rejected or accepted and become permanent. By default, the Track Changes panel will also be displayed when converting a DOCX document to another format, however, there is an option to hide it completely using GroupDocs.Conversion for .NET API.
The following code snippet shows how to convert a DOCX document to PDF and hide tracked changes pane:
Microsoft Word document content is often formatted with different fonts like Arial, Calibri, Times New Roman etc., and these fonts are usually stored at the computer where the document is originally created or edited. Sometimes it happens that during DOCX document conversion to another format, some fonts used by a particular document are not present on the computer where conversion is performed. So the resulting converted document may look too different from the original file.
Of course GroupDocs.Conversion for .NET will try to select the most appropriate font substitution from available font sources and fonts embedded in the original document, but you can also specify font substitution explicitly. For doing this it is just needed to call the Create method of FontSubstitute class and provide names for original and substitute fonts.
The following code snippet shows how to convert a DOCX document with font substitution for missing fonts:
Func<LoadContext,LoadOptions>getLoadOptions=loadContext=>newWordProcessingLoadOptions{DefaultFont="Helvetica",FontSubstitutes=newList<FontSubstitute>{FontSubstitute.Create("Tahoma","Arial"),FontSubstitute.Create("Times New Roman","Arial"),}};using(Converterconverter=newConverter("sample.docx",getLoadOptions)){PdfConvertOptionsoptions=newPdfConvertOptions();converter.Convert("converted.pdf",options);}
Skip loading of external resources
In the context of word-processing documents, external resources refer to any elements, materials, or data that are not directly embedded within the document itself but are referenced or linked to enhance the document’s content or functionality. These external resources can take various forms and are often used to supplement the text and improve the overall quality and richness of the document. Common external resources include images and graphics, tables and spreadsheets, audio and video, fonts, styles, data sources, mathematical equations and so on.
External resources are not loaded by default. Read the Skip loading of external resources article to learn how to allow trusted resources and decide per resource with a handler in GroupDocs.Conversion for .NET.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.