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
If false, GroupDocs.Conversion uses the DefaultFont for the substitution of missing fonts. If true, GroupDocs.Conversion evaluates all the related fields in FontInfo (Panose, Sig etc) for the missing font and finds the closest match among the available font sources.
Specifies which external resources will be loaded even when the loading of other external resources is restricted.
Note: that the font substitution mechanism will override the DefaultFont in cases when FontInfo for the missing font is available in the document.
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, you can use the following code sample to do this with a couple of lines of C# code:
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:
Contracts.Func<LoadOptions>getLoadOptions=()=>newWordProcessingLoadOptions{AutoFontSubstitution=false,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.
In some cases, you may want to skip loading all or just some of the external resources during the conversion. For example, when these resources become unavailable. Read the Skip loading of external resources article to learn how to do this with 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.