From 72648f4a3f68f4144f2cc139a33e8e96c00c97e3 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 12:41:32 +0530 Subject: [PATCH 1/7] Task 1042501: Revamp Getting Started page in Word to PDF Conversion in Documentation - Hotfix --- .../NET/Assemblies-required-word-to-pdf.md | 30 ++- .../Convert-Word-Document-to-PDF-in-Blazor.md | 11 +- .../NET/Fallback-fonts-word-to-pdf.md | 56 +++-- .../Word-To-PDF/NET/Faqs-word-to-pdf.md | 34 ++- .../NET/Font-substituion-word-to-pdf.md | 28 ++- .../Nuget-packages-required-word-to-pdf.md | 224 ++++++++---------- .../Word-To-PDF/NET/Performance-metrics.md | 14 +- .../NET/Unsupported-elements-word-to-pdf.md | 59 +++-- .../Word-To-PDF/NET/Word-to-pdf-settings.md | 52 ++-- .../multithreading-in-word-to-pdf-faqs.md | 115 +++++---- .../NET/word-to-pdf-conversion-faqs.md | 32 ++- .../NET/word-to-pdf-linux-docker.md | 2 +- .../Word-To-PDF/NET/word-to-pdf.md | 100 ++++---- .../Word/Conversions/Word-To-PDF/overview.md | 52 ++-- .../Word/Conversions/html-conversions.md | 66 +++--- .../markdown-to-word-conversion.md | 145 ++++++------ .../Word/Conversions/overview.md | 4 +- .../Word/Conversions/rtf-conversions.md | 70 +++--- .../Word/Conversions/text-conversions.md | 58 +++-- .../word-file-formats-conversions.md | 30 +-- .../Conversions/word-to-epub-conversion.md | 25 +- .../word-to-markdown-conversion.md | 23 +- .../Conversions/word-to-odt-conversion.md | 16 +- 23 files changed, 692 insertions(+), 554 deletions(-) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Assemblies-required-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Assemblies-required-word-to-pdf.md index d8010cdf1d..ce4738e112 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Assemblies-required-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Assemblies-required-word-to-pdf.md @@ -7,8 +7,12 @@ documentation: UG --- # Assemblies required to convert Word document to PDF +This page lists the Syncfusion assemblies that must be referenced in your project to convert a Word document to PDF. The required assemblies differ based on the target platform (WPF, Windows Forms, ASP.NET Core, Blazor, WinUI, .NET MAUI, etc.). Use the tables below to identify the assemblies for your platform, and refer to the linked per-platform guides for step-by-step setup. + ## Converting Word document to PDF +### Active platforms + For converting a Word document to PDF, the following assemblies need to be referenced in your application @@ -39,11 +43,13 @@ T> 1. If you encounter issues while using the .NET Word library in ASP.NET Core, T> 2. Switch to NuGet packages for a seamless experience: T> * Get frequent bug fixes every week. T> * Upgrade quickly with no manual effort. -T> Note: To avoid trail watermark when using NuGet packages, it is recommended to register license key in application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. -T> -T> Refer [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) to know more about NuGet packages required. -#### Retired Platforms + +N> To avoid a trial watermark when using NuGet packages, it is recommended to register a license key in the application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +N> +N> Refer [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) to know more about NuGet packages required. + +### Retired platforms The following assemblies need to be referenced in your application based on the platform. @@ -74,7 +80,7 @@ N> 8. Starting with the v27.1.x, if you reference "Syncfusion.DocIORenderer", yo ## Converting Charts -The following assemblies are required to be referred in addition to the above mentioned assemblies for converting the chart present in the Word document into PDF. +The following assemblies are required to be referenced in addition to the above mentioned assemblies for converting the chart present in the Word document into PDF.
@@ -87,7 +93,7 @@ WPF, Windows Forms, ASP.NET MVC
Syncfusion.OfficeChartToImageConverter.WPF
Syncfusion.SfChart.WPF
-#### Retired Platforms +### Retired platforms The following assemblies need to be referenced in your application based on the platform. @@ -101,4 +107,14 @@ Assembly
ASP.NET
Syncfusion.OfficeChartToImageConverter.WPF
Syncfusion.SfChart.WPF
- \ No newline at end of file + + +## See also + +* [NuGet packages required for Word to PDF conversion](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) +* [Word to PDF conversion overview](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf) +* [Word to PDF settings](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings) +* [Fallback fonts for Word to PDF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/fallback-fonts-word-to-pdf) +* [Licensing overview](https://help.syncfusion.com/common/essential-studio/licensing/overview) +* [Syncfusion Reference Manager add-in](https://help.syncfusion.com/extension/syncfusion-reference-manager/overview) +* [ASP.NET Core DocIO troubleshooting guide](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues#things-to-check-while-facing-an-issue-in-word-library) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Convert-Word-Document-to-PDF-in-Blazor.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Convert-Word-Document-to-PDF-in-Blazor.md index 18e1e672ea..288897ab7b 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Convert-Word-Document-to-PDF-in-Blazor.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Convert-Word-Document-to-PDF-in-Blazor.md @@ -953,11 +953,7 @@ Step 2: To **convert a Word document to PDF in the Blazor WebAssembly Standalone N> 1. If deploying the application in a Linux environment, refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf#additional-nuget-packages-required-for-linux) for the required additional NuGet packages. N> 2. Starting with v16.2.0.x, if Syncfusion® assemblies are referenced from trial setup or from the NuGet feed, the "Syncfusion.Licensing" assembly reference must also be added and a license key included in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in an application to use Syncfusion components. -N> 3. If you face issues related to SkiaSharp during runtime, install the necessary WebAssembly tools by running the following commands in the terminal: -N> ``` -N> dotnet workload install wasm-tools -N> ``` -N> After completing the installation, restart Visual Studio Code to ensure proper integration of the tools. + Step 3: Create a Razor file named `DocIO.razor` in the `Pages` folder. @@ -1176,11 +1172,6 @@ Step 2: Install the NuGet packages from [NuGet.org](https://www.nuget.org/). N> 1. If deploying the application in a Linux environment, refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf#additional-nuget-packages-required-for-linux) for the required additional NuGet packages. N> 2. Starting with v16.2.0.x, if Syncfusion® assemblies are referenced from trial setup or from the NuGet feed, the "Syncfusion.Licensing" assembly reference must also be added and a license key included in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in an application to use Syncfusion components. -N> 3. If you face issues related to SkiaSharp during runtime, install the necessary WebAssembly tools by running the following commands in the terminal: -N> ``` -N> dotnet workload install wasm-tools -N> ``` -N> After completing the installation, restart JetBrains Rider to ensure proper integration of the tools. Step 3: Create a Razor file named `DocIO.razor` in the `Pages` folder. diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md index c7db2a22f5..e97124d36d 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Fallback-fonts-word-to-pdf.md @@ -1,6 +1,6 @@ --- title: Fallback fonts in Word to PDF Conversion in C# | DocIO | Syncfusion -description: Learn about how to specify fallback fonts during Word to PDF conversion using the .NET Word (DocIO) library.. +description: Learn how to specify fallback fonts during Word to PDF conversion using the .NET Word (DocIO) library. platform: document-processing control: DocIO documentation: UG @@ -8,18 +8,32 @@ documentation: UG # Fallback fonts in Word to PDF Conversion -During Word to PDF conversions, if a glyph of the input text is unavailable in the specified font, the text will not be rendered properly. To address this, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) allows users to specify fallback fonts. When a glyph is missing, the library will use one of the fallback fonts to render the text correctly in the output PDF document. +During Word to PDF conversions, if a glyph of the input text is unavailable in the specified font, the text will not be rendered properly. To address this, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) allows developers to specify fallback fonts. When a glyph is missing, the library uses one of the fallback fonts to render the text correctly in the output PDF document. Users can configure fallback fonts in the following ways: * Initialize default fallback fonts. -* Set custom fonts as fallback fonts for specific script types, including Arabic, Hebrew, Chinese, Japanese, and more. +* Set custom fonts as fallback fonts for specific script types, including Arabic, Hebrew, Chinese, Japanese, Tamil, Korean, and more. +* Set custom fonts as fallback fonts for symbols, mathematics, and emoji. * Set custom fonts as fallback fonts for a particular range of Unicode text. -N> DocIO internally uses user-initialized or specified fallback fonts for Unicode characters during Word to PDF conversion. Therefore, the specified fallback fonts must be installed in the production environment or embedded in the input Word document (DOCX). Otherwise, it will not render the text properly using the fallback fonts. +N> DocIO internally uses the specified fallback fonts for Unicode characters during Word to PDF conversion. Therefore, the specified fallback fonts must be installed in the production environment or embedded in the input Word document (DOCX). Otherwise, the text will not render properly using the fallback fonts. + +## Prerequisites + +To use fallback fonts during Word to PDF conversion, install the required Syncfusion NuGet packages. For more information on NuGet packages and assemblies, refer to the [NuGet packages required for Word to PDF](Nuget-packages-required-word-to-pdf) and [Assemblies required for Word to PDF](./Assemblies-required-word-to-pdf) documentation. + +The following namespaces are used in the code examples throughout this document: + +```csharp +using Syncfusion.DocIO.DLS; +using Syncfusion.DocIORenderer; +using Syncfusion.Office; +using Syncfusion.Pdf; +``` ## Initialize default fallback fonts -The following code example demonstrates how to initialize a default fallback fonts while converting a Word document to PDF. The *InitializeDefault* API sets the default fallback fonts for specific script types like Arabic, Hebrew, Chinese, Japanese etc. +The following code example demonstrates how to initialize the default fallback fonts while converting a Word document to PDF. The `InitializeDefault` API sets the default fallback fonts for specific script types like Arabic, Hebrew, Chinese, Japanese, and others. {% tabs %} @@ -197,7 +211,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Fallback fonts for symbols -The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which DocIO considers internally when converting a Word document to PDF. +The following code example demonstrates how users can add fallback fonts for symbols, mathematics, and emojis, which DocIO considers internally when converting a Word document to PDF. {% tabs %} @@ -257,7 +271,7 @@ using (WordDocument wordDocument = new WordDocument("Template.docx", Syncfusion. {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads an existing Word document. Using wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx) - 'Adds fallback font for basic symbols Like bullet characters. + 'Adds fallback font for basic symbols like bullet characters. wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Symbols, "Segoe UI Symbol, Arial Unicode MS, Wingdings") 'Adds fallback font for mathematics symbols. wordDocument.FontSettings.FallbackFonts.Add(ScriptType.Mathematics, "Cambria Math, Noto Sans Math, Segoe UI Symbol, Arial Unicode MS") @@ -276,13 +290,15 @@ End Using {% endtabs %} -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-symbol-based-on-scripttype/) +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-symbol-based-on-scripttype). ## Fallback fonts for range of Unicode text -Users can set fallback fonts for specific Unicode range of text to be used in Word to PDF conversion. +Users can set fallback fonts for a specific range of Unicode characters to be used in Word to PDF conversion. + +The following code example demonstrates how developers can add fallback fonts by using a specific Unicode range that DocIO considers internally while converting a Word document to PDF. -The following code example demonstrates how users can add fallback fonts by using a specific Unicode range of text that DocIO considers internally while converting a Word document to PDF. +N> The `FallbackFont` constructor accepts the start and end of the Unicode range (inclusive) and the font name: `new FallbackFont(rangeStart, rangeEnd, "FontName")`. {% tabs %} @@ -387,9 +403,11 @@ End Using You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Fallback-fonts-for-Unicode-range). -## Modify the exiting fallback fonts +## Modify the existing fallback fonts -The following code example demonstrates how user can modify or customize the existing fallback fonts using *FontNames* API while converting a Word document to PDF. +The following code example demonstrates how users can modify or customize the existing fallback fonts using the `FontNames` API while converting a Word document to PDF. + +N> Calling `InitializeDefault()` populates the `FallbackFonts` collection with the default entries shown in the [Supported script types](#supported-script-types) table. Modifying the `FontNames` property of a `FallbackFont` instance overrides the default font list for that script type only. {% tabs %} @@ -571,7 +589,7 @@ Yu Mincho, MS Mincho -Thai +Thai 0x0E00 - 0x0E7F @@ -582,7 +600,7 @@ Tahoma, Microsoft Sans Serif -Korean +Korean 0xAC00 - 0xD7A3
@@ -806,3 +824,13 @@ Malgun Gothic, Batang Segoe UI Emoji, Noto Color Emoji, Arial Unicode MS + +N> The Unicode ranges in the table are inclusive on both ends. A character belongs to the script type if its code point falls within any listed range. If a character matches multiple script types, DocIO uses the first matching entry when resolving fallback fonts. + +## See also + +* [Font substitution in Word to PDF conversion](Font-substituion-word-to-pdf) +* [NuGet packages required for Word to PDF conversion](Nuget-packages-required-word-to-pdf) +* [Assemblies required for Word to PDF conversion](Assemblies-required-word-to-pdf) +* [Word to PDF conversion settings](Word-to-pdf-settings) +* [Frequently asked questions about Word to PDF conversion](Faqs-word-to-pdf) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md index 8a0b9a51a3..7f975d3aa9 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md @@ -1,24 +1,40 @@ --- -title: Word to PDF conversion FAQs | DocIO | Syncfusion -description: Learn about the frequently asked questions of Word to PDF conversion in the .NET Word (DocIO) library. +title: Word to PDF Conversion FAQs | DocIO | Syncfusion +description: Find answers to common questions about converting Word documents to PDF using using .NET Word (DocIO) library without Microsoft Word or interop dependencies. +keywords: Word to PDF FAQ, DocIO FAQ, Word conversion FAQ, chart conversion, Azure, content controls, multithreading platform: document-processing control: DocIO documentation: UG --- -# Frequently Asked Questions +# Frequently Asked Questions (Word to PDF) The frequently asked questions about Word to PDF conversion in Essential® DocIO are listed below. -* [Could not find Syncfusion.OfficeChartToImageConverter assembly in .NET 3.5 Framework, does it mean there is no support for chart conversion in this Framework?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#could-not-find-syncfusionofficecharttoimageconverter-assembly-in-net-35-framework-does-it-mean-there-is-no-support-for-chart-conversion-in-this-framework) +## Chart conversion + +* [Could not find Syncfusion.OfficeChartToImageConverter assembly in .NET 3.5 Framework. Does it mean there is no support for chart conversion in this framework?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#could-not-find-syncfusionofficecharttoimageconverter-assembly-in-net-35-framework-does-it-mean-there-is-no-support-for-chart-conversion-in-this-framework) + > Note: .NET Framework 3.5 is end-of-life and no longer supported. * [Is it possible to convert 3D charts to PDF?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#is-it-possible-to-convert-3d-charts-to-pdf) + +## PDF conformance and output + * [Is it possible to specify PDF conformance level in Word to PDF conversion?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#is-it-possible-to-specify-pdf-conformance-level-in-word-to-pdf-conversion) -* [Which one is better Azure App Service or Cloud Service for Word to PDF using DocIO?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#which-one-is-better-azure-app-service-or-cloud-service-for-word-to-pdf-using-docio) -* [Why images are preserved as RedX images in Word to PDF conversion?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#why-images-are-preserved-as-redx-images-in-word-to-pdf-conversion) + +## Deployment + +* [Which one is better, Azure App Service or Cloud Service, for Word to PDF using DocIO?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#which-one-is-better-azure-app-service-or-cloud-service-for-word-to-pdf-using-docio) + +## Troubleshooting + +* [Why are images preserved as red-X images in Word to PDF conversion?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#why-images-are-preserved-as-redx-images-in-word-to-pdf-conversion) * [Why are content controls not preserved as editable form fields in the converted PDF document even when PreserveFormFields is enabled?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-conversion-faqs#why-are-content-controls-not-preserved-as-editable-form-fields-in-the-converted-pdf-document-even-when-preserveformfields-is-enabled) -* [How to perform mail merge in Word document and convert it as PDF in WinForms?](https://support.syncfusion.com/kb/article/19782/how-to-perform-mail-merge-in-word-document-and-convert-it-as-pdf-in-winforms) -* [How to add numbers on pages in HTML to PDF in ASP.NET DocIO?](https://support.syncfusion.com/kb/article/19446/how-to-add-numbers-on-pages-in-html-to-pdf-in-aspnet-docio?isInternalRefresh=False) ## Multithreading -* [Does the Word library support multithreading and thread-safety for Word to PDF conversion?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/faqs/multithreading-word-to-pdf-faqs#does-the-word-library-support-multithreading-and-thread-safety-for-word-to-pdf-conversion) \ No newline at end of file +* [Does the Word library support multithreading and thread-safety for Word to PDF conversion?](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/faqs/multithreading-word-to-pdf-faqs#does-the-word-library-support-multithreading-and-thread-safety-for-word-to-pdf-conversion) + +## Related knowledge base articles + +* [How to perform mail merge in a Word document and convert it to PDF in WinForms](https://support.syncfusion.com/kb/article/19782/how-to-perform-mail-merge-in-word-document-and-convert-it-as-pdf-in-winforms) +* [How to add numbers on pages in HTML to PDF in ASP.NET DocIO?](https://support.syncfusion.com/kb/article/19446/how-to-add-numbers-on-pages-in-html-to-pdf-in-aspnet-docio?isInternalRefresh=False) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Font-substituion-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Font-substituion-word-to-pdf.md index 1664f52c10..fd50b5b61e 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Font-substituion-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Font-substituion-word-to-pdf.md @@ -8,17 +8,23 @@ documentation: UG # Font Substitution in Word to PDF Conversion -When the necessary fonts used in the Word document has not been installed in the production machine, then Essential® DocIO uses the ”Microsoft Sans Serif” as default font for rendering the text. This leads to preservation difference in generated PDF as each font has different glyphs for characters. To learn more about the default font substitution, click [here](https://support.syncfusion.com/kb/article/6821/what-happens-when-the-word-document-used-fonts-for-a-text-is-not-installed-in-production). +When the necessary fonts used in the Word document have not been installed in the production machine, then Essential® DocIO uses the "Microsoft Sans Serif" as default font for rendering the text. This leads to preservation differences in the generated PDF, as each font has different glyphs for characters. To learn more about the default font substitution, click [here](https://support.syncfusion.com/kb/article/6821/what-happens-when-the-word-document-used-fonts-for-a-text-is-not-installed-in-production). To avoid this, the Essential® DocIO library allows you to set an alternate font for the missing font used in the Word document. -## Use alternate font from installed fonts +The library supports the following font substitution approaches during Word to PDF conversion: + +* **Use an alternate font from installed fonts** – substitute with a font that is already installed on the production machine. +* **Use an alternate font without installing** – load the replacement font from a file stream without installing it on the machine. +* **Embed fonts** – embed the required TrueType font glyphs directly into the converted PDF. For more details, see [Embedding fonts in Word to PDF conversion](./Word-to-pdf-settings#embedding-fonts). + +## Use an alternate font from installed fonts You can use any other alternate fonts instead of "Microsoft Sans Serif" to layout and render the text during Word to PDF conversion by using the [SubstituteFont](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.FontSettings.html) event. -N> Hook the [SubstituteFont](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.FontSettings.html#Syncfusion_DocIO_DLS_FontSettings_SubstituteFont) event only after the Word document is loaded to ensure it works correctly. +N> Hook the [SubstituteFont](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.FontSettings.html#Syncfusion_DocIO_DLS_FontSettings_SubstituteFont) event only after the Word document is loaded. This ensures the event fires correctly. -The following code example shows how to use alternate font instead of "Microsoft Sans Serif" when the specified font is not installed in the machine. +The following code example shows how to use an alternate font instead of "Microsoft Sans Serif" when the specified font is not installed in the machine. {% tabs %} @@ -76,7 +82,7 @@ wordDocument.ChartToImageConverter = New ChartToImageConverter() 'Hooks the font substitution event AddHandler wordDocument.FontSettings.SubstituteFont, AddressOf FontSettings_SubstituteFont 'Creates an instance of the DocToPDFConverter -Dim converter As DocToPDFConverter = New DocToPDFConverter +Dim converter As DocToPDFConverter = New DocToPDFConverter() 'Converts Word document into PDF document Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument) 'Unhooks the font substitution event after converting to PDF @@ -142,9 +148,9 @@ End Sub You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Use-alternate-installed-font). -### Event Handler to use alternate font without installing +### Event Handler to use an alternate font without installing -The following code example shows how to use the alternate fonts instead of "Microsoft Sans Serif" **without installing the fonts** into production machine. +The following code example shows how to use alternate fonts instead of "Microsoft Sans Serif" **without installing the fonts** on the production machine. {% tabs %} @@ -152,7 +158,7 @@ The following code example shows how to use the alternate fonts instead of "Micr private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args) { //Sets the alternate font when a specified font is not installed in the production environment - if (args.OrignalFontName == "Arial Unicode MS") + if (args.OriginalFontName == "Arial Unicode MS") { //Sets the alternate font based on the font style. switch (args.FontStyle) @@ -175,7 +181,7 @@ private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args) { //Sets the alternate font when a specified font is not installed in the production environment - if (args.OrignalFontName == "Arial Unicode MS") + if (args.OriginalFontName == "Arial Unicode MS") { //Sets the alternate font based on the font style. switch (args.FontStyle) @@ -195,9 +201,9 @@ private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -Private Sub SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs) +Private Sub FontSettings_SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs) 'Sets the alternate font when a specified font is not installed in the production environment - If args.OrignalFontName = "Arial Unicode MS" Then + If args.OriginalFontName = "Arial Unicode MS" Then 'Sets the alternate font based on the font style. Select Case args.FontStyle Case FontStyle.Italic diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Nuget-packages-required-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Nuget-packages-required-word-to-pdf.md index c806025f3d..9759fbe7e8 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Nuget-packages-required-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Nuget-packages-required-word-to-pdf.md @@ -1,4 +1,4 @@ ---- +--- title: NuGet Packages Required to Convert Word to PDF | Syncfusion description: Learn the NuGet packages required to Convert Word document to PDF using the .NET Word (DocIO) library. platform: document-processing @@ -8,9 +8,9 @@ documentation: UG # NuGet Packages Required to Convert Word to PDF -## Converting Word document to PDF +## Converting a Word Document to PDF -For converting Word document into PDF, the following NuGet packages need to be installed in your application. +For converting a Word document into PDF, the following NuGet packages need to be installed in your application. @@ -26,12 +26,13 @@ Package manager console command + + - - - - - - - - - - +
-{{'[Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-window-forms)'|  markdownify }}, Console Application (Targeting .NET Framework) +{{'[Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-window-forms)'|  markdownify }}, Console Application (Targeting .NET Framework) -Syncfusion.DocToPdfConverter.WinForms.nupkg +Syncfusion.DocToPdfConverter.WinForms Install-Package Syncfusion.DocToPdfConverter.WinForms @@ -39,43 +40,22 @@ Install-Package Syncfusion.DocToPdfConverter.WinForms
-{{'[WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-wpf)'|  markdownify }} +{{'[WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-wpf)'|  markdownify }} -Syncfusion.DocToPdfConverter.Wpf.nupkg +Syncfusion.DocToPdfConverter.Wpf Install-Package Syncfusion.DocToPdfConverter.Wpf
-.NET Framework 3.5 or 4.0 Client Profile - -Syncfusion.DocToPdfConverter.ClientProfile.nupkg - -Install-Package Syncfusion.DocToPdfConverter.ClientProfile -
-{{'[ASP.NET MVC4](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc)'|  markdownify }} - -Syncfusion.DocToPdfConverter.AspNet.Mvc4.nupkg - -Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4 -
-{{'[ASP.NET MVC5](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc)'|  markdownify }} +{{'[ASP.NET MVC5](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc)'|  markdownify }} -Syncfusion.DocToPdfConverter.AspNet.Mvc5.nupkg +Syncfusion.DocToPdfConverter.AspNet.Mvc5 Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5 @@ -83,13 +63,13 @@ Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5
-{{'[ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-core)'|  markdownify }}, Console Application (Targeting .NET Core) and {{'[Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-blazor)'|  markdownify }} +{{'[ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-core)'|  markdownify }}, Console Application (Targeting .NET Core) and {{'[Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-blazor)'|  markdownify }} -Syncfusion.DocIORenderer.Net.Core.nupkg
+Syncfusion.DocIORenderer.Net.Core

Note:
-Please refer {{'[here](https://help.syncfusion.com/document-processing/word/word-library/net/faq#what-are-the-nuget-packages-to-be-installed-to-perform-word-to-pdf-conversion-in-linux-os)'| markdownify }} to know about the NuGet packages that need to be installed to perform Word to PDF conversion in Linux OS.
+Please refer {{'[here](https://help.syncfusion.com/document-processing/word/word-library/net/faq#what-are-the-nuget-packages-to-be-installed-to-perform-word-to-pdf-conversion-in-linux-os)'| markdownify }} to know about the NuGet packages that need to be installed to perform Word to PDF conversion in Linux OS.
Install-Package Syncfusion.DocIORenderer.Net.Core @@ -97,15 +77,16 @@ Install-Package Syncfusion.DocIORenderer.Net.Core
-{{'[Windows UI Library (WinUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-winui)'|  markdownify }}
{{'[.NET Multi-platform App UI (.NET MAUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-maui)'|  markdownify }} +{{'[Windows UI Library (WinUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-winui)'|  markdownify }}
{{'[.NET Multi-platform App UI (.NET MAUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-maui)'|  markdownify }}
-Syncfusion.DocIORenderer.NET +Syncfusion.DocIORenderer.NET Install-Package Syncfusion.DocIORenderer.NET
T> If you encounter issues while using the .NET Word library in ASP.NET Core, refer to the [troubleshooting guide](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues#things-to-check-while-facing-an-issue-in-word-library) for recommended checks and solutions. @@ -133,7 +114,7 @@ Package manager console command {{'[ASP.NET](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net)' | markdownify}}
-Syncfusion.DocToPdfConverter.AspNet.nupkg +Syncfusion.DocToPdfConverter.AspNet Install-Package Syncfusion.DocToPdfConverter.AspNet @@ -141,27 +122,52 @@ Install-Package Syncfusion.DocToPdfConverter.AspNet -{{'[Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-xamarin)'|  markdownify }}
+{{'[ASP.NET MVC4](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc)'|  markdownify }} -Syncfusion.DocIORenderer.NET +Syncfusion.DocToPdfConverter.AspNet.Mvc4 + + +Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4 + + + + +{{'[Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-xamarin)'|  markdownify }}
+ + +Syncfusion.Xamarin.DocIORenderer Install-Package Syncfusion.Xamarin.DocIORenderer + -N> 1. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +N> 1. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add the "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering the Syncfusion® license key in your application to use our components. N> 2. Syncfusion® components are available in [nuget.org](https://www.nuget.org/) N> 3. Please refer the procedure to deploy your .NET Core application in Linux OS from [here](https://support.syncfusion.com/kb/article/7626/how-to-deploy-net-core-application-with-word-to-pdf-conversion-capabilities-in-linux-os). N> 4. From v32.1.19, the dependent package SkiaSharp is upgraded from 3.116.1 to 3.119.1 version and it is mandatory to use SkiaSharp.NativeAssets.Linux v3.119.1 and HarfBuzzSharp.NativeAssets.Linux v8.3.1.2 packages for converting Word documents into PDF in Linux environment. -N> 5. "DocIO supports Word to PDF conversion in UWP application using DocIORenderer." For further information, please refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp) -N> 6. Syncfusion has **deprecated the ASP.NET package**. We strongly recommend upgrading your applications to ASP.NET Core. Refer [here](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/migrate-from-net-framework-to-net-core) to migrate from .NET Framework to .NET Core. +N> 5. "DocIO supports Word to PDF conversion in a UWP application using DocIORenderer." For further information, please refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp) +N> 6. Syncfusion has **deprecated the Syncfusion.DocToPdfConverter.AspNet package**. We strongly recommend upgrading your applications to ASP.NET Core. Refer [here](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/migrate-from-net-framework-to-net-core) to migrate from .NET Framework to .NET Core. ### Additional NuGet packages required for Linux -The SkiaSharp and HarfBuzzSharp native asset NuGet packages are required as additional dependencies when deploying your application in Linux environments. There are two types of NuGet packages—choose the appropriate ones based on your specific Linux environment. +The SkiaSharp and HarfBuzzSharp native asset NuGet packages are required as additional dependencies when deploying your application in Linux environments. There are two types of NuGet packages. Choose the appropriate ones based on your specific Linux environment. + +Run one of the following commands in the Package Manager Console (or use `dotnet add package` for SDK-style projects): + +```powershell +// Common Linux distributions, Azure App Service, Google App Engine +Install-Package SkiaSharp.NativeAssets.Linux -Version 3.119.1 +Install-Package HarfBuzzSharp.NativeAssets.Linux -Version 8.3.1.2 +``` + +```powershell +// AWS Lambda, AWS Elastic Beanstalk (use the NoDependencies variant) +Install-Package SkiaSharp.NativeAssets.Linux.NoDependencies -Version 3.119.1 +``` The following table illustrates the native assets NuGet packages and their applicable Linux environments: @@ -202,7 +208,9 @@ The following table illustrates the native assets NuGet packages and their appli ## Converting Charts -The following NuGet package need to be installed additionally to preserve chart as image in Word to PDF conversion. +The following NuGet package needs to be installed additionally to preserve a chart as image in Word to PDF conversion. + +> **Note:** The chart-to-image converter package is only required for .NET Framework targets (WinForms, WPF, ASP.NET MVC4, ASP.NET MVC5, and the retired ASP.NET). For ASP.NET Core, Blazor, WinUI, .NET MAUI, and Xamarin, the base `Syncfusion.DocIORenderer.Net.Core` or `Syncfusion.DocIORenderer.NET` package handles chart rendering natively and no additional chart package is needed. @@ -223,7 +231,7 @@ Package manager console command Windows Forms, Console Application (Targeting .NET Framework) - - - - - +
-Syncfusion.OfficeChartToImageConverter.WinForms.nupkg +Syncfusion.OfficeChartToImageConverter.WinForms Install-Package Syncfusion.OfficeChartToImageConverter.WinForms @@ -234,7 +242,7 @@ Install-Package Syncfusion.OfficeChartToImageConverter.WinForms WPF -Syncfusion.OfficeChartToImageConverter.Wpf.nupkg +Syncfusion.OfficeChartToImageConverter.Wpf Install-Package Syncfusion.OfficeChartToImageConverter.Wpf @@ -242,31 +250,21 @@ Install-Package Syncfusion.OfficeChartToImageConverter.Wpf
-ASP.NET MVC4 - -Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4.nupkg - -Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -
ASP.NET MVC5 -Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5.nupkg +Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5
-#### Retired Platforms +#### Retired Platforms (Charts) -The following NuGet packages need to be included in your application based on the platform. +The following NuGet packages need to be included in your application based on the retired platform. @@ -287,12 +285,24 @@ Package manager console command ASP.NET
+ + + + + +
-Syncfusion.OfficeChartToImageConverter.AspNet.nupkg +Syncfusion.OfficeChartToImageConverter.AspNet Install-Package Syncfusion.OfficeChartToImageConverter.AspNet
+ASP.NET MVC4 + +Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 + +Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 +
## NuGet Package Installation and Uninstallation @@ -307,27 +317,27 @@ DocIO NuGet packages can be installed and uninstalled using Package Manager Cons The package contains the DocToPdfConverter .NET library that allows you to convert the Word documents to PDF. -~~~ +```powershell // Install package Install-Package Syncfusion.DocToPdfConverter.WinForms -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.DocToPdfConverter.WinForms -RemoveDependencies -~~~ +``` **NuGet Package:** Syncfusion.OfficeChartToImageConverter.WinForms The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.WinForms -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.OfficeChartToImageConverter.WinForms -RemoveDependencies -~~~ +``` ### WPF @@ -335,55 +345,27 @@ Uninstall-Package Syncfusion.OfficeChartToImageConverter.WinForms -RemoveDepende The package contains the DocToPdfConverter .NET library that allows you to convert the Word documents to PDF. -~~~ +```powershell // Install package Install-Package Syncfusion.DocToPdfConverter.Wpf -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.DocToPdfConverter.Wpf -RemoveDependencies -~~~ +``` **NuGet Package:** Syncfusion.OfficeChartToImageConverter.Wpf The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.Wpf -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.OfficeChartToImageConverter.Wpf -RemoveDependencies -~~~ - -### ASP.NET MVC4 - -**NuGet Package:** Syncfusion.DocToPdfConverter.AspNet.Mvc4 - -The package contains the DocToPdfConverter .NET library that allows you to convert the Word documents to PDF. - -~~~ -// Install package -Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4 -~~~ -~~~ -// Uninstall package -Uninstall-Package Syncfusion.DocToPdfConverter.AspNet.Mvc4 -RemoveDependencies -~~~ - -**NuGet Package:** Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 - -The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. - -~~~ -// Install package -Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -~~~ -~~~ -// Uninstall package -Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -RemoveDependencies -~~~ +``` ### ASP.NET MVC5 @@ -391,52 +373,52 @@ Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -RemoveDepe The package contains the DocToPdfConverter .NET library that allows you to convert the Word documents to PDF. -~~~ +```powershell // Install package Install-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5 -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.DocToPdfConverter.AspNet.Mvc5 -RemoveDependencies -~~~ +``` **NuGet Package:** Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -RemoveDependencies -~~~ +``` ### ASP.NET Core and Blazor **NuGet Package:** Syncfusion.DocIORenderer.Net.Core The package contains the DocIORenderer .NET portable library that allows you to convert the Word documents to PDF. -~~~ +```powershell // Install package Install-Package Syncfusion.DocIORenderer.Net.Core -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.DocIORenderer.Net.Core -RemoveDependencies -~~~ +``` ### Windows UI Library (WinUI) and .NET Multi-platform App UI (.NET MAUI) **NuGet Package:** Syncfusion.DocIORenderer.NET The package contains the DocIORenderer .NET library that allows you to convert the Word documents to PDF. -~~~ +```powershell // Install package Install-Package Syncfusion.DocIORenderer.NET -~~~ -~~~ +``` +```powershell // Uninstall package Uninstall-Package Syncfusion.DocIORenderer.NET -RemoveDependencies -~~~ +``` diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Performance-metrics.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Performance-metrics.md index 9a366019c9..66850e1c0f 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Performance-metrics.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Performance-metrics.md @@ -1,5 +1,5 @@ --- -title: Word to PDF Performance benchmark results | Syncfusion +title: Word to PDF performance benchmark results | Syncfusion description: Explore the performance benchmark results of Word to PDF conversion using the .NET Word Library with different page counts platform: document-processing control: DocIO @@ -8,7 +8,7 @@ documentation: UG # Word to PDF performance benchmarks using .NET Word Library -The Syncfusion® .NET Word library (DocIO) enables high-performance Word document processing, including conversion to PDF. This performance benchmark report highlights the speed and efficiency of Word to PDF conversion, demonstrating how our library performs across varying document sizes in real-world scenarios. +The Syncfusion® .NET Word library (DocIO) enables high-performance Word document processing, including conversion to PDF. This performance benchmark report highlights the speed and efficiency of Word to PDF conversion, demonstrating how our library performs across different conversion operations on representative workloads. ## Environment @@ -20,10 +20,18 @@ The following system configurations were used for benchmarking: * **.NET Version:** .NET 8.0 * **Syncfusion® Version:** [Syncfusion.DocIORenderer.Net.Core v33.1.44](https://www.nuget.org/packages/Syncfusion.DocIORenderer.Net.Core/33.1.44) +## Test methodology + +* All measurements were taken on an idle system with no other significant background processes running. +* Each operation was executed for **3 iterations** after a warm-up run, and the reported time is the **average** of the measured iterations. +* Conversions were run **single-threaded** with default garbage collection settings. +* Time values are reported in **seconds (sec)** and rounded to two decimal places for consistency. + ## Benchmark Results -The table below shows the performance results of various Word document operations, evaluated using predefined input conditions in the previously described environment. +The table below shows the performance results of various Word to PDF conversion operations, evaluated using predefined input conditions in the previously described environment. Each row lists the operation, the number of pages in the sample document, the average conversion time, and a link to the corresponding GitHub example. +> **Note:** The "Word to PDF" baseline row uses a 100-page sample to reflect a realistic large-document workload, while the other rows use small (1–2 page) sample documents to isolate the overhead of each individual option. Times are therefore **not directly comparable across rows**; they are intended to illustrate the relative cost of enabling each option on a similar small document. diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Unsupported-elements-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Unsupported-elements-word-to-pdf.md index 64fe6ca2d4..59b0478416 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Unsupported-elements-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Unsupported-elements-word-to-pdf.md @@ -8,7 +8,7 @@ documentation: UG # Limitations in Word to PDF Conversion -The following tables shows the limitations of Word to PDF conversion. +The following table shows the limitations of Word to PDF conversion.
Operation
@@ -30,7 +30,7 @@ Only DOCX and WordML format documents are supported. Chart @@ -81,7 +81,7 @@ Mathematical equations extending to multiple lines will be rendered in a single SmartArt @@ -94,10 +94,18 @@ Not supported + + + + @@ -105,12 +113,12 @@ First watermark of the Word document should be applied to the entire converted P Multi-Column Texts
- Only DOCX and WordML format documents are supported from .NET Framework 4.0 onwards. + Only DOCX and WordML format documents are supported on .NET Framework 4.0 and later, as well as on .NET, ASP.NET Core, Blazor, WinUI, .NET MAUI, and Xamarin.

The following chart types are not supported on all platforms:
    @@ -62,7 +62,7 @@ Only DOCX and WordML format documents are supported.
-Custom Shapes +Custom Shapes Only DrawingML custom shapes in DOCX and WordML format documents are supported. @@ -73,7 +73,7 @@ Only DrawingML custom shapes in DOCX and WordML format documents are supported. Equation -Mathematical equations extending to multiple lines will be rendered in a single line and content exceeding the right margin will clip in the PDF. +Mathematical equations extending to multiple lines will be rendered in a single line and content exceeding the right margin will be clipped in the PDF.
-Supported only in DOCX format document to PDF. Additional behavior explained {{ '[here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#smartart)' | markdownify }}. +Supported only in DOCX format document to PDF. Additional behavior is explained in the [SmartArt](#smartart) section below.
+Drawing Canvas + +Not supported programmatically. See the [Drawing Canvas](#drawing-canvas) section below for details. +
Watermark -First watermark of the Word document should be applied to the entire converted PDF document when the Word document have multiple watermarks. +The first watermark of the Word document is applied to the entire converted PDF document when the Word document has multiple watermarks.
-Multi-Column text positions are calculated dynamically when layout the text. So, there may be some content position differences occur in the PDF document. +Multi-Column text positions are calculated dynamically when laying out the text. As a result, there may be some content position differences in the PDF document.
-Footnote and endnote +Footnote and Endnote Number formats in Roman, Alphabets, and Arabic only supported. @@ -118,7 +126,7 @@ Number formats in Roman, Alphabets, and Arabic only supported.
-Textbox +TextBox Linked text boxes are not supported. @@ -126,10 +134,10 @@ Linked text boxes are not supported.
-Ink elements +Ink Elements -Supported only in DOCX format document to PDF. Additional behavior explained {{ '[here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#ink)' | markdownify }}. +Supported only in DOCX format document to PDF. Additional behavior is explained in the [Ink](#ink) section below.
@@ -154,7 +162,7 @@ Only DOCX and WordML format documents are supported. Pagination -The Essential® DocIO makes sensible decision when layout the text, and its supported elements while generating the PDF documents. But however, there may not be guaranteed pagination with all the documents. +DocIO makes sensible decisions when laying out the text and its supported elements while generating the PDF documents. However, pagination is not guaranteed for all documents. @@ -178,7 +186,7 @@ Not supported Borders -Using of patterns and 3D borders are not retained in the output PDF document. +Pattern fills and 3D borders are not retained in the output PDF document. @@ -239,7 +247,7 @@ Some elements have additional limitations or require manual steps to ensure accu SmartArt typically contains graphic properties, including bounds information for SmartArt and its nodes. When creating or modifying SmartArt using the Syncfusion Word Library, these graphic properties (e.g., bounds information) are not generated. Due to this limitation, SmartArt created or modified using the Syncfusion Word Library may not be accurately preserved during Word-to-PDF and image conversions. -**To resolve this**, first save the document using DocIO before converting it to a PDF or image. Then, open the saved document in Microsoft Word, save it again, and finally convert it to a PDF or image using DocIO. This regenerates the required SmartArt properties, ensuring accurate output. +**To resolve this**, save the document using DocIO first, then open the saved document in Microsoft Word and save it again. Finally, convert it to a PDF or image using DocIO. This regenerates the required SmartArt properties, ensuring accurate output. ### Drawing Canvas @@ -249,13 +257,15 @@ Creating, editing, or cloning Drawing Canvas elements programmatically is not su During Word-to-PDF and Word-to-Image conversions, Syncfusion Word Library uses fallback images embedded in the document to preserve the Ink visual appearance. However, when Ink is created or modified using the Syncfusion Word Library, some Ink effects cannot be rendered accurately due to rendering engine limitations. Although the Ink stroke geometry is preserved, visual brush effects are lost. -**To resolve this**, save the created or modified document using DocIO first in DOCX format. Then, open the saved document in Microsoft Word and save it again. Finally, convert it to PDF or Image using DocIO. This process regenerates the required Ink fallback images, ensuring accurate visual output. +**To resolve this**, save the created or modified document using DocIO first in DOCX format, then open the saved document in Microsoft Word and save it again. Finally, convert it to PDF or Image using DocIO. This process regenerates the required Ink fallback images, ensuring accurate visual output. ## Show Warning for Unsupported Elements -When converting a Word document to a PDF, the presence of unsupported elements in the input Word document can lead to preservation issues in the converted PDF. The .NET Word library (DocIO) contains [Warning](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocToPDFConverter.DocToPDFConverterSettings.html#Syncfusion_DocToPDFConverter_DocToPDFConverterSettings_Warning) API, which helps to detect and handle these unsupported elements during the conversion process. This API holds the information of unsupported elements once found in the input Word document. +> **Prerequisites:** Refer to the [NuGet packages required for Word to PDF conversion](nuget-packages-required-word-to-pdf) and ensure the required assemblies are referenced in your project. -Users can display warning messages for the unsupported elements using the [WarningType](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WarningInfo.html#Syncfusion_DocIO_DLS_WarningInfo_WarningType) during Word to PDF conversion. Users can set a flag to stop the conversion process based on the warning. +When converting a Word document to a PDF, the presence of unsupported elements in the input Word document can lead to preservation issues in the converted PDF. The .NET Word library (DocIO) provides the [Warning](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocToPDFConverter.DocToPDFConverterSettings.html#Syncfusion_DocToPDFConverter_DocToPDFConverterSettings_Warning) API (and the equivalent [DocIORenderer.Settings.Warning](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIORenderer.DocIORendererSettings.html#Syncfusion_DocIORenderer_DocIORendererSettings_Warning) for cross-platform scenarios), which helps to detect and handle these unsupported elements during the conversion process. This API holds the information of unsupported elements found in the input Word document. + +Users can display warning messages for the unsupported elements using the [WarningType](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WarningInfo.html#Syncfusion_DocIO_DLS_WarningInfo_WarningType) enumeration during Word to PDF conversion. Users can also set a flag to stop the conversion process when a warning is encountered. The following code demonstrates how to stop conversion if the input Word document has an unsupported element like SmartArt during Word to PDF conversion. @@ -275,7 +285,7 @@ using (FileStream fileStream = new FileStream("Input.docx", FileMode.Open)) //Converts Word document into a PDF document. using (PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument)) { - //If the IsCanceled boolean is enabled, the input document will contain an unsupported element. + //If the IsCanceled property is true, the input document contained an unsupported element. if (renderer.IsCanceled) { Console.WriteLine("The execution stopped due to unsupported element."); @@ -299,8 +309,8 @@ using (FileStream fileStream = new FileStream("Input.docx", FileMode.Open)) WordDocument wordDocument = new WordDocument("Input.docx"); DocToPDFConverter converter = new DocToPDFConverter(); converter.Settings.Warning = new DocumentWarning(); -PdfDocument pdfDocument = converter.ConvertToPDF(document); -//If the IsCanceled boolean is enabled, the input document will contain an unsupported element. +PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument); +//If the IsCanceled property is true, the input document contained an unsupported element. if (converter.IsCanceled) { Console.WriteLine("The execution stopped due to unsupported element."); @@ -320,9 +330,9 @@ else Dim wordDocument As New WordDocument("Input.docx") Dim converter As New DocToPDFConverter() converter.Settings.Warning = New DocumentWarning() -Dim pdfDocument As PdfDocument = converter.ConvertToPDF(document) +Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument) -' If the IsCanceled boolean is enabled, the input document will contain an unsupported element. +' If the IsCanceled property is true, the input document contained an unsupported element. If converter.IsCanceled Then Console.WriteLine("The execution stopped due to unsupported element.") Console.ReadKey() @@ -337,11 +347,14 @@ End If {% endtabs %} -The following code demonstrates how to initialize the [Warning](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocToPDFConverter.DocToPDFConverterSettings.html#Syncfusion_DocToPDFConverter_DocToPDFConverterSettings_Warning) API and display warning messages for all unsupported elements in the input document. Additionally, this code shows how to set a flag to stop Word to PDF conversion if an unsupported element is identified. +The following code demonstrates how to implement the [IWarning](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.IWarning.html) interface and display warning messages for all unsupported elements in the input document. Additionally, this code shows how to set a flag to stop Word to PDF conversion if an unsupported element is identified. The same `DocumentWarning` class is used by both the cross-platform (`DocIORenderer`) and Windows-specific (`DocToPDFConverter`) workflows. + +The supported [WarningType](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WarningInfo.html#Syncfusion_DocIO_DLS_WarningInfo_WarningType) values include (but are not limited to): `SmartArt`, `Ink`, `Chart`, `Shape`, `TextBox`, `Watermark`, and `Equation`. Refer to the API reference for the complete list. {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} +//The same class is used for the Windows-specific workflow. public class DocumentWarning : IWarning { public bool ShowWarnings(List warningInfo) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Word-to-pdf-settings.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Word-to-pdf-settings.md index 6ce9fe9dee..c49bf0aff8 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Word-to-pdf-settings.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Word-to-pdf-settings.md @@ -163,7 +163,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Accessible PDF document -This setting allows you to determine whether to preserve document structured tags in the converted **PDF document for accessibility (508 compliance) support**. This property will set the title and description for images, diagrams and other objects in the generated PDF document. This information will be useful for **people with vision or cognitive impairments** who may not able to see or understand the object +This setting allows you to determine whether to preserve document structured tags in the converted **PDF document for accessibility (508 compliance) support**. This property will set the title and description for images, diagrams and other objects in the generated PDF document. This information will be useful for **people with vision or cognitive impairments** who may not be able to see or understand the object. The following code sample shows how to preserve document structured tags in the converted PDF document. @@ -228,7 +228,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Word document headings to PDF bookmarks -This setting allows you to determine whether to **preserve Word document headings** (i.e., paragraph with heading style and outline level) as bookmarks in the converted PDF document. As per Microsoft Word behavior, either Word document headings or bookmarks can be exported as PDF bookmarks. By default, DocIO preserves Word documents bookmarks as PDF bookmarks in converted PDF document. +This setting allows you to determine whether to **preserve Word document headings** (i.e., paragraph with heading style and outline level) as bookmarks in the converted PDF document. As per Microsoft Word behavior, either Word document headings or bookmarks can be exported as PDF bookmarks. By default, DocIO preserves Word document bookmarks as PDF bookmarks in converted PDF document. The following code sample shows how to preserve Word document headings as bookmarks in the converted PDF document. @@ -291,6 +291,8 @@ wordDocument.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Export-Word-headings-into-PDF). +### Preserve headings and bookmarks + The following code sample shows how to preserve both Word document headings and Bookmarks as PDF bookmarks in the converted PDF document. {% tabs %} @@ -352,7 +354,7 @@ wordDocument.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Export-Word-bookmarks-into-PDF). -## Word document form field to PDF form field. +## Word document form field to PDF form field This setting allows you to determine whether to **preserve Word document form fields** (Text form field, Checkbox form field and Drop-down form field) as PDF form fields in the converted PDF document. This features helps in **creating fillable PDF forms from Word document**. @@ -417,10 +419,12 @@ wordDocument.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Create-fillable-PDF-from-Word). -## Image quality +## Image quality This setting allows you to determine the **quality of the charts and JPEG images** in the converted PDF document. +N> Image quality customization is supported only in Windows Forms, WPF, ASP.NET, and ASP.NET MVC platforms. + The following code sample shows how to customize the image quality of charts and JPEG images in the converted PDF document. {% tabs %} @@ -483,6 +487,8 @@ This setting allows you to regenerate the nested EMF images present in the Word This property is recommended to resolve the scaling problem of nested metafile images by regenerating the nested metafile images present in the Word document. +N> Recreate Nested Metafile is supported only in Windows Forms, WPF, ASP.NET, and ASP.NET MVC platforms. It is also supported in .NET Core 3.0 when using the DocToPDFConverter assembly instead of DocIORenderer. + The following code sample shows how to use this property to regenerate the nested EMF images present in the Word document during PDF conversion. {% tabs %} @@ -529,7 +535,7 @@ wordDocument.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Recreate-nested-metafile). -## Identical image optimization +## Identical image optimization This setting **reduces the Main Memory usage** in Word to PDF conversion by reusing the identical images. @@ -822,7 +828,8 @@ You can download a complete working sample from [GitHub](https://github.com/Sync Essential® DocIO now allows hyphenating text in a Word document while converting it to PDF format based on the given language dictionaries. These dictionaries prescribe where words of a specific language can be hyphenated. Use the dictionary files as OpenOffice format dictionary. N> 1. If automatic hyphenation is not enabled in the Word document, you can enable it by using [WordDocument.Properties.Hyphenation.AutoHyphenation](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.Hyphenation.html#Syncfusion_DocIO_DLS_Hyphenation_AutoHyphenation) of DocIO. -N> 2. After converting Word documents to PDF, release any dictionary file streams to avoid memory leaks. Call [Hyphenator.UnloadDictionaries()](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.Hyphenator.html#Syncfusion_DocIO_DLS_Hyphenator_UnloadDictionaries) to free hyphenation resources and optimize performance. +N> 2. You can obtain OpenOffice hyphenation dictionary files from the [OpenOffice dictionary repository](https://github.com/LibreOffice/dictionaries). +N> 3. After converting Word documents to PDF, release any dictionary file streams to avoid memory leaks. Call [Hyphenator.UnloadDictionaries()](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.Hyphenator.html#Syncfusion_DocIO_DLS_Hyphenator_UnloadDictionaries) to free hyphenation resources and optimize performance. The following code sample shows how to hyphenate text in a Word document while converting it to PDF format. @@ -838,13 +845,14 @@ DocIORenderer renderer = new DocIORenderer(); FileStream dictionaryStream = new FileStream("hyphen_en_US.dic", FileMode.Open); //Adds the hyphenation dictionary of the specified language Hyphenator.Dictionaries.Add("en-US", dictionaryStream); +dictionaryStream.Dispose(); //Converts Word document into PDF document PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument); //Closes the instance of Word document object wordDocument.Close(); //Releases the resources occupied by DocIORenderer instance renderer.Dispose(); -//Saves the PDF file +//Saves the PDF file MemoryStream outputStream = new MemoryStream(); pdfDocument.Save(outputStream); //Closes the instance of PDF document object @@ -864,7 +872,7 @@ FileStream dictionaryStream = new FileStream("hyphen_en_US.dic", FileMode.Open, Hyphenator.Dictionaries.Add("en-US", dictionaryStream); //Converts Word document into PDF document PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument); -//Saves the PDF file +//Saves the PDF file pdfDocument.Save("WordtoPDF.pdf"); //Closes the instance of document objects wordDocument.Close(); @@ -879,12 +887,12 @@ wordDocument.ChartToImageConverter = New ChartToImageConverter() 'Creates an instance of the DocToPDFConverter Dim converter As New DocToPDFConverter() 'Adds the hyphenation dictionary of the specified language -Dim dictionaryStream As New FileStream("hyphen_en_US .dic", mode:=FileMode.Open) +Dim dictionaryStream As New FileStream("hyphen_en_US.dic", mode:=FileMode.Open) 'Adds the hyphenation dictionary of the specified language Hyphenator.Dictionaries.Add("en-US", dictionaryStream) 'Converts Word document into PDF document Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument) -'Saves the PDF file +'Saves the PDF file pdfDocument.Save("WordtoPDF.pdf") 'Closes the instance of document objects pdfDocument.Close(True) @@ -897,6 +905,8 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Track changes in Word-to-PDF conversion +### Preserve track changes + The following code sample shows how to **preserve revision marks in a generated PDF** when converting Word documents with tracked changes or revisions. {% tabs %} @@ -944,7 +954,7 @@ pdfDocument.Close(); {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads an existing Word document Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx) -'Sets revision types to preserve track changes in when converting to PDF conversion. +'Sets revision types to preserve track changes when converting to PDF. wordDocument.RevisionOptions.ShowMarkup = RevisionType.Deletions Or RevisionType.Formatting Or RevisionType.Insertions 'Creates an instance of the DocToPDFConverter @@ -967,7 +977,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ### Change the Track Changes Color -You can customize how track changes markup appears in a generated PDF when converting Word documents into PDF. The following code sample shows how to customize revision marks colors. +You can customize the track changes markup that appears in a generated PDF when converting Word documents into PDF. The following code sample shows how to customize revision marks colors. {% tabs %} @@ -1222,6 +1232,8 @@ You can download a complete working sample from [GitHub](https://github.com/Sync This setting allows you to preserve Ole Equation as bitmap image in the converted PDF document. +N> Preserving Ole Equation as bitmap image is supported only in Windows Forms, WPF, ASP.NET, and ASP.NET MVC platforms. + The following code sample shows how to preserve Ole Equation as bitmap image in the converted PDF document. {% tabs %} @@ -1268,11 +1280,11 @@ wordDocument.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Ole-Equation-as-bitmap). -## Restrict all permission in a PDF document +## Restrict all permissions in a PDF document -You can restrict all the permission in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). +You can restrict all permissions in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). -The below code example shows how to restrict Copying and Printing permission of the PDF document. +The code example below shows how to restrict Copying and Printing permission of the PDF document. {% tabs %} @@ -1292,13 +1304,13 @@ PdfSecurity security = pdfDocument.Security; security.KeySize = PdfEncryptionKeySize.Key256Bit; security.Algorithm = Syncfusion.Pdf.Security.PdfEncryptionAlgorithm.AES; security.OwnerPassword = "syncfusion"; -//It restrict printing and copying of PDF document +//It restricts printing and copying of PDF document security.Permissions = ~(PdfPermissionsFlags.CopyContent | PdfPermissionsFlags.Print); //Releases all resources used by the Word document and DocIO Renderer objects render.Dispose(); wordDocument.Dispose(); //Saves the PDF file -FileStream outputFile = new FileStream("Output.docx", FileMode.OpenOrCreate, FileAccess.ReadWrite); +FileStream outputFile = new FileStream("Output.pdf", FileMode.OpenOrCreate, FileAccess.ReadWrite); pdfDocument.Save(outputFile); //Closes the instance of PDF document object pdfDocument.Close(); @@ -1307,7 +1319,7 @@ outputFile.Dispose(); {% highlight c# tabtitle="C# [Windows-specific]" %} //Creates an instance of WordDocument class -WordDocument document = new WordDocument("Template.docx"); +WordDocument document = new WordDocument("Template.docx", FormatType.Docx); //Creates an instance of the DocToPDFConverter DocToPDFConverter converter = new DocToPDFConverter(); //Converts Word document into PDF document @@ -1328,7 +1340,7 @@ document.Close(); {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Creates an instance of WordDocument class -Dim document As WordDocument = New WordDocument("Template.docx") +Dim document As WordDocument = New WordDocument("Template.docx", FormatType.Docx) 'Creates an instance of the DocToPDFConverter Dim converter As DocToPDFConverter = New DocToPDFConverter() 'Converts Word document into PDF document @@ -1339,7 +1351,7 @@ Dim security As PdfSecurity = pdfDocument.Security security.KeySize = PdfEncryptionKeySize.Key256Bit security.Algorithm = Syncfusion.Pdf.Security.PdfEncryptionAlgorithm.AES security.OwnerPassword = "syncfusion" -'It restrict printing and copying of PDF document +'It restricts printing and copying of PDF document security.Permissions = Not (PdfPermissionsFlags.CopyContent Or PdfPermissionsFlags.Print) pdfDocument.Save("Output.pdf") pdfDocument.Close() diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/faqs/multithreading-in-word-to-pdf-faqs.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/faqs/multithreading-in-word-to-pdf-faqs.md index cac8c50ba4..937e4876f1 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/faqs/multithreading-in-word-to-pdf-faqs.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/faqs/multithreading-in-word-to-pdf-faqs.md @@ -1,57 +1,58 @@ --- title: FAQ about multithreading in Word to PDF | DocIO | Syncfusion -description: Learn about the FAQs regarding the support of multithreading in Word to PDF conversion using the .NET Word (DocIO) library. +description: Learn about multithreading and thread-safety support in Word to PDF conversion using the .NET Word (DocIO) library. platform: document-processing control: DocIO documentation: UG --- -# Frequently asked questions about multithreading in Word to PDF +# Multithreading in Word to PDF conversion -The frequently asked questions regarding multithreading and thread-safety support in Word to PDF conversion are listed below. +This page covers multithreading and thread-safety support in Word to PDF conversion. ## Does the Word library support multithreading and thread-safety for Word to PDF conversion? Yes, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) is thread-safe, and you can create multiple instances of the [WordDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html) class to load the same file as multiple copies or different Word files, then convert them to PDF using multithreading in C#. -### Multithreading Word to PDF using tasks +### Frequently asked questions about multithreading in Word to PDF The following code example illustrates how to use multithreading to convert multiple copies of a Word document to PDF by creating multiple tasks in C#. {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} + class MultiThreading { - //Indicates the number of threads to be create. + // Indicates the number of threads to be created. private const int TaskCount = 1000; public static async Task Main() { - //Create an array of tasks based on the TaskCount. + // Create an array of tasks based on the TaskCount. Task[] tasks = new Task[TaskCount]; for (int i = 0; i < TaskCount; i++) { tasks[i] = Task.Run(() => ConvertWordToPDF()); } - //Ensure all tasks complete by waiting on each task. + // Ensure all tasks complete by waiting on each task. await Task.WhenAll(tasks); } - //Convert a Word document to PDF using multi-threading. + // Convert a Word document to PDF using multi-threading. static void ConvertWordToPDF() { using (FileStream inputStream = new FileStream("Input.docx", FileMode.Open, FileAccess.Read)) { - //Load an existing Word document. + // Load an existing Word document. using (WordDocument document = new WordDocument(inputStream, FormatType.Docx)) { - //Create an instance of DocIORenderer. + // Create an instance of DocIORenderer. using (DocIORenderer renderer = new DocIORenderer()) { - //Convert Word document to PDF. + // Convert Word document to PDF. using (PdfDocument pdfDocument = renderer.ConvertToPDF(document)) { - //Save the PDF document. - using (FileStream outputFileStream = new FileStream("Output" + Guid.NewGuid().ToString() +".pdf", FileMode.Create, FileAccess.Write)) + // Save the PDF document. + using (FileStream outputFileStream = new FileStream("Output" + Guid.NewGuid().ToString() + ".pdf", FileMode.Create, FileAccess.Write)) { pdfDocument.Save(outputFileStream); } @@ -64,31 +65,32 @@ class MultiThreading {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} + class MultiThreading { - //Indicates the number of threads to be create. + // Indicates the number of threads to be created. private const int TaskCount = 1000; public static async Task Main() { - //Create an array of tasks based on the TaskCount. + // Create an array of tasks based on the TaskCount. Task[] tasks = new Task[TaskCount]; for (int i = 0; i < TaskCount; i++) { tasks[i] = Task.Run(() => ConvertWordToPDF()); } - //Ensure all tasks complete by waiting on each task. + // Ensure all tasks complete by waiting on each task. await Task.WhenAll(tasks); } - //Convert a Word document to PDF using multi-threading. + // Convert a Word document to PDF using multi-threading. static void ConvertWordToPDF() { using (FileStream inputStream = new FileStream("Input.docx", FileMode.Open, FileAccess.Read)) { - //Load an existing Word document. + // Load an existing Word document. using (WordDocument document = new WordDocument(inputStream, FormatType.Docx)) { - //Create an instance of DocToPDFConverter. + // Create an instance of DocToPDFConverter. using (DocToPDFConverter converter = new DocToPDFConverter()) { //Convert Word document to PDF. @@ -106,29 +108,30 @@ class MultiThreading {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} + Module MultiThreading - 'Indicates the number of threads to be create. + ' Indicates the number of threads to be created. Private Const TaskCount As Integer = 1000 Public Sub Main() - 'Create an array of tasks based on the TaskCount. + ' Create an array of tasks based on the TaskCount. Dim tasks(TaskCount - 1) As Task For i As Integer = 0 To TaskCount - 1 tasks(i) = Task.Run(Sub() ConvertWordToPDF()) Next - 'Ensure all tasks complete by waiting on each task. + ' Ensure all tasks complete by waiting on each task. Task.WhenAll(tasks).Wait() End Sub - 'Convert a Word document to PDF using multi-threading. + ' Convert a Word document to PDF using multi-threading. Private Sub ConvertWordToPDF() Using inputStream As New FileStream("Input.docx", FileMode.Open, FileAccess.Read, FileShare.Read) - 'Load an existing Word document. + ' Load an existing Word document. Using document As New WordDocument(inputStream, FormatType.Docx) - 'Create an instance of DocToPDFConverter. + ' Create an instance of DocToPDFConverter. Using converter As New DocToPDFConverter() - 'Convert Word document to PDF. + ' Convert Word document to PDF. Using pdfDocument As PdfDocument = converter.ConvertToPDF(document) - 'Save the PDF document. + ' Save the PDF document. Using outputFileStream As New FileStream("Output" & Guid.NewGuid().ToString() & ".pdf", FileMode.Create, FileAccess.Write) pdfDocument.Save(outputFileStream) End Using @@ -144,41 +147,44 @@ End Module You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Multithreading-using-tasks). +> **Note:** When running many concurrent tasks, wrap the `Task.WhenAll` call in a `try`/`catch` to handle `AggregateException` and inspect individual task exceptions as needed. + ### Multithreading Word to PDF using parallel process -The following code example illustrates how to use a parallel for loop to process multiple tasks concurrently, converting Word documents to PDF using multithreading in C#. +The following code example illustrates how to use a parallel `for` loop to process multiple tasks concurrently, converting Word documents to PDF using multithreading in C#. {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} + class MultiThreading { static void Main(string[] args) { - //Indicates the number of threads to be create. + // Indicates the number of threads to be created. int limit = 5; Console.WriteLine("Parallel For Loop"); Parallel.For(0, limit, count => { Console.WriteLine("Task {0} started", count); - //Convert multiple Word document, one document on each thread. + // Convert multiple Word documents, one document on each thread. ConvertWordToPDF(count); Console.WriteLine("Task {0} is done", count); }); } - //Convert a Word document to PDF using multi-threading. + // Convert a Word document to PDF using multi-threading. static void ConvertWordToPDF(int count) { using (FileStream inputStream = new FileStream("Input.docx", FileMode.Open, FileAccess.Read)) { - //Load an existing Word document. + // Load an existing Word document. using (WordDocument document = new WordDocument(inputStream, FormatType.Docx)) { - //Create an instance of DocIORenderer. + // Create an instance of DocIORenderer. using (DocIORenderer renderer = new DocIORenderer()) { - //Convert Word document to PDF. + // Convert Word document to PDF. PdfDocument pdfDocument = renderer.ConvertToPDF(document); //Save the PDF document. using (FileStream outputFileStream = new FileStream("Output" + count + ".pdf", FileMode.Create, FileAccess.Write)) @@ -195,37 +201,38 @@ class MultiThreading {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} + class MultiThreading { static void Main(string[] args) { - //Indicates the number of threads to be create. + // Indicates the number of threads to be created. int limit = 5; Console.WriteLine("Parallel For Loop"); Parallel.For(0, limit, count => { Console.WriteLine("Task {0} started", count); - //Convert multiple Word document, one document on each thread. + // Convert multiple Word documents, one document on each thread. ConvertWordToPDF(count); Console.WriteLine("Task {0} is done", count); }); } - //Convert a Word document to PDF using multi-threading. + // Convert a Word document to PDF using multi-threading. static void ConvertWordToPDF(int count) { using (FileStream inputStream = new FileStream("Input.docx", FileMode.Open, FileAccess.Read)) { - //Load an existing Word document. + // Load an existing Word document. using (WordDocument document = new WordDocument(inputStream, FormatType.Docx)) { - //Create an instance of DocToPDFConverter. + // Create an instance of DocToPDFConverter. using (DocToPDFConverter converter = new DocToPDFConverter()) { - //Convert Word document to PDF. + // Convert Word document to PDF. using (PdfDocument pdfDocument = converter.ConvertToPDF(document)) { - //Save the PDF document. + // Save the PDF document. using (FileStream outputFileStream = new FileStream("Output" + count + ".pdf", FileMode.Create, FileAccess.Write)) { pdfDocument.Save(outputFileStream); @@ -239,30 +246,30 @@ class MultiThreading {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} + Module MultiThreading Public Sub Main(args As String()) - ' Indicates the number of threads to be create. + ' Indicates the number of threads to be created. Dim limit As Integer = 5 Console.WriteLine("Parallel For Loop") - ' Parallel For Loop Parallel.For(0, limit, Sub(count) Console.WriteLine("Task {0} started", count) - 'Convert multiple Word document, one document on each thread. + ' Convert multiple Word documents, one document on each thread. ConvertWordToPDF(count) Console.WriteLine("Task {0} is done", count) End Sub) End Sub - ' Convert multiple Word document to PDF using multi-threading. + ' Convert multiple Word documents to PDF using multi-threading. Private Sub ConvertWordToPDF(count As Integer) - Using inputStream As New FileStream("Input.docx", FileMode.Open, FileAccess.Read) - 'Load an existing Word document. + Using inputStream As New FileStream("Input.docx", FileMode.Open, FileAccess.Read, FileShare.Read) + ' Load an existing Word document. Using document As New WordDocument(inputStream, FormatType.Docx) - 'Create an instance of DocToPDFConverter. + ' Create an instance of DocToPDFConverter. Using converter As New DocToPDFConverter() - 'Convert Word document to PDF. + ' Convert Word document to PDF. Using pdfDocument As PdfDocument = converter.ConvertToPDF(document) - 'Save the PDF document. + ' Save the PDF document. Using outputFileStream As New FileStream("Output" & count.ToString() & ".pdf", FileMode.Create, FileAccess.Write) pdfDocument.Save(outputFileStream) End Using @@ -276,4 +283,10 @@ End Module {% endtabs %} -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Multithreading-using-parallel-process). \ No newline at end of file +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Multithreading-using-parallel-process). + +## See also + +* [Word to PDF conversion overview](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/overview) +* [Assemblies required for Word to PDF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/assemblies-required-word-to-pdf) +* [NuGet packages required for Word to PDF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-conversion-faqs.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-conversion-faqs.md index c60686c0cc..39e931c885 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-conversion-faqs.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-conversion-faqs.md @@ -6,17 +6,19 @@ control: DocIO documentation: UG --- -# Frequently Asked Questions +# Frequently Asked Questions (Word to PDF) -The frequently asked questions about Word to PDF conversion in Essential® DocIO are listed below. +The frequently asked questions about Word to PDF conversion in Essential® DocIO are listed below. This page addresses common questions on chart conversion, PDF conformance, font handling, form fields, track changes, and platform-specific issues. -## Could not find Syncfusion.OfficeChartToImageConverter assembly in .NET 3.5 Framework, does it mean there is no support for chart conversion in this Framework? +## Could not find Syncfusion.OfficeChartToImageConverter assembly in the .NET 3.5 Framework. Does it mean there is no support for chart conversion in this framework? -Yes, OfficeChartToImageConverter assembly is not supported in .NET 3.5 Framework and it is available in .NET 4.0 Framework. +Yes, the OfficeChartToImageConverter assembly is not supported in the .NET 3.5 Framework. It is available in the .NET 4.0 Framework and later versions. To use chart conversion, upgrade your project to .NET 4.0 or higher. For the list of required assemblies, refer to the [Assemblies required for Word to PDF conversion](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/assemblies-required-word-to-pdf) documentation. ## Is it possible to convert 3D charts to PDF? -Current version of the DocIO library does not provide support for converting 3D charts to PDF format. +The current version of the DocIO library does not provide support for converting 3D charts to PDF format. + +**Workaround:** As an alternative, you can render the 3D chart as an image using the [OfficeChartToImageConverter](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-charts) and then insert that image into the Word document before conversion. For more information, refer to the [Working with Charts](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-charts) documentation. ## Is it possible to specify PDF conformance level in Word to PDF conversion? @@ -31,11 +33,15 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## How to validate the PDF conformance level in a DocIO-converted PDF? -PDF conformance can be verified using tools like **Adobe Acrobat Pro, VeraPDF, Xodo Validator, and PDFCreator Validator**. These tools check if the PDF meets compliance standards. DocIO-generated PDFs can be validated using any of these tools to ensure compliance with the required standards. +PDF conformance can be verified using tools like **Adobe Acrobat Pro, VeraPDF and PDFCreator Validator**. These tools check if the PDF meets compliance standards. DocIO-generated PDFs can be validated using any of these tools to ensure compliance with the required standards. + +For more details on the supported conformance levels in DocIO, refer to [PDF Conformance](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/working-with-pdf-conformance). ## Is it possible to preserve track changes revisions in a Word document as comments in a PDF using DocIO? -When a Word document with revisions is converted to a PDF using Microsoft Word, the revisions are preserved as balloons. So, it is not possible to preserve revisions in a Word document as comments in a PDF. Using DocIO, revisions can be displayed as balloons in the converted PDF by enabling the [ShowMarkup](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.RevisionOptions.html#Syncfusion_DocIO_DLS_RevisionOptions_ShowMarkup) property. Refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#show-or-hide-revisions-in-balloons) and [GitHub sample](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Show-or-hide-revisions-in-balloons) for implementation. +No. When a Word document with revisions is converted to a PDF using Microsoft Word, the revisions are preserved as balloons (revision marks) rather than as comments. Likewise, DocIO cannot convert track changes revisions into PDF comments. + +**What DocIO supports:** You can display the revisions as balloons in the converted PDF by enabling the [ShowMarkup](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.RevisionOptions.html#Syncfusion_DocIO_DLS_RevisionOptions_ShowMarkup) property. Refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#show-or-hide-revisions-in-balloons) and [GitHub sample](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Show-or-hide-revisions-in-balloons) for implementation. ## Why does a Word document converted to PDF on one device not display correctly when converted on another device? @@ -45,9 +51,11 @@ For more details with implementation, refer to the [documentation](https://help. ## Why are Chinese characters missing or blank in the PDF after Word-to-PDF conversion? -Chinese characters may not appear in the converted PDF if the original Word document uses fonts like **Calibri**, which do not support Chinese glyphs in PDFs. +Chinese characters may not appear in the converted PDF if the original Word document uses fonts like Calibri, which do not support Chinese glyphs in PDFs. -To render Chinese and other Unicode characters correctly, we **recommend using the Arial Unicode MS font in your Word document**. If Arial Unicode MS is not installed on the machine during conversion, the characters will not display properly in the output PDF. To resolve this, **install the Arial Unicode MS font** on the system before converting the document. +To render Chinese and other Unicode characters correctly, we recommend using the *Arial Unicode MS* font in your Word document. If Arial Unicode MS is not installed on the machine during conversion, the characters will not display properly in the output PDF. To resolve this, install the *Arial Unicode MS* font on the system before converting the document. + +For more details on configuring fallback fonts for missing glyphs, refer to the [Fallback fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/fallback-fonts-word-to-pdf) documentation. ## What is the difference between font substitution and fallback fonts in Word to PDF conversion? @@ -66,7 +74,7 @@ To render Chinese and other Unicode characters correctly, we **recommend using t Replaces an entirely missing font. - When It’s Used + When It's Used A font is present but lacks specific character glyphs. The required font is not installed on the system. @@ -99,7 +107,9 @@ This exception typically occurs due to version mismatches between SkiaSharp and ## Why does System.TypeInitializationException occur during Word to PDF or image conversion in Linux using Syncfusion DocIO? -This error usually occurs due to an incompatible GLIBC version on the Linux system. SkiaSharp, used by DocIO for rendering, requires a minimum GLIBC version to function correctly. For example, SkiaSharp version 3.119.1 requires at least GLIBC version 2.29, which is not available in older Linux distributions like Debian 10. If a lower version is present, the conversion may fail with errors such as GLIBC_2.29 not found. To resolve this, ensure the operating system includes the required GLIBC version for the SkiaSharp version being used, or upgrade to a newer Linux distribution. +This error usually occurs due to an incompatible GLIBC version on the Linux system. SkiaSharp, used by DocIO for rendering, requires a minimum GLIBC version to function correctly. For example, SkiaSharp version 3.119.1 requires at least GLIBC version 2.29, which is not available in older Linux distributions like Debian 10. If a lower version is present, the conversion may fail with an error such as `GLIBC_2.29 not found`. + +**Resolution:** Ensure the operating system includes the required GLIBC version for the SkiaSharp version being used, or upgrade to a newer Linux distribution. For the list of supported Linux distributions, refer to the [Convert Word document to PDF in Linux](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux) documentation. ## Is it possible to substitute fonts in a Word document? diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-linux-docker.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-linux-docker.md index dbe2607c9a..28b87f211b 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-linux-docker.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf-linux-docker.md @@ -17,7 +17,7 @@ The following prerequisites are required before you begin: * [.NET SDK 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) * [Docker Desktop](https://www.docker.com/products/docker-desktop/) (Windows/macOS) or Docker Engine (Linux) installed and running * A valid Syncfusion® license key. Refer to this [licensing guide](https://help.syncfusion.com/common/essential-studio/licensing/overview) to generate and register a key. -* Visual Studio 2022 or laterwith the **.NET desktop development** and **.NET Core cross-platform development** workloads (for the "Add Docker Support" steps in Visual Studio) +* Visual Studio 2022 or later with the **.NET desktop development** and **.NET Core cross-platform development** workloads (for the "Add Docker Support" steps in Visual Studio) ## Steps to convert a Word document to PDF in Linux Docker diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf.md index b9de21ded9..7f94eb9ba2 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/word-to-pdf.md @@ -8,10 +8,20 @@ documentation: UG # Convert Word to PDF in .NET using Syncfusion® Word (DocIO) library -The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert Word document to PDF within a few lines of code in .NET applications and also it does not require Adobe and Microsoft Word application to be installed in the machine. Using this, you can create an input Word document from scratch or load an existing Word document and then easily convert to PDF. +The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert a Word document to PDF within a few lines of code in .NET applications. It does not require Adobe Acrobat or Microsoft Word to be installed on the machine. Using this library, you can create a Word document from scratch or load an existing Word document and then easily convert it to PDF. The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) to PDF converter offers high versatility and seamless performance across various .NET platforms, including [Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-window-forms), [WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-wpf), [ASP.NET](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net), [ASP.NET MVC](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc), [ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-core), [Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-blazor), [Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-xamarin), [WinUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-winui), [.NET MAUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-maui). Also, in different environments like [Azure](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-azure), [AWS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-aws), [Google Cloud](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-google-cloud-platform), [Linux](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux), [Docker](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-linux-docker), and [macOS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-mac). +## Assemblies and NuGet packages required + +Refer to the following links for the assemblies and NuGet packages required based on your platform to convert a Word document to PDF. + +* [Word to PDF conversion assemblies](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/assemblies-required-word-to-pdf) +* [Word to PDF conversion NuGet packages](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) + +For a quick walkthrough on converting a Word document to a PDF, check out this video: +{% youtube "https://www.youtube.com/watch?v=8QdevnBxgHk" %} + ## Key Features * Ability to [embed fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embedding-fonts) within the PDF for consistent display. @@ -26,19 +36,14 @@ The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library * Ability to use custom dictionaries for [text hyphenation](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#hyphenation-in-word-to-pdf-conversion) in the converted PDF. * Support for preserving revision marks of [tracked changes](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#track-changes-in-word-to-pdf-conversion) in the converted PDF. * Option to toggle between preserving or excluding [comments](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#comments-in-word-to-pdf-conversion) during Word to PDF conversions. -* Option to [show warnings for any unsupported elements](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf#show-warning-for-unsupported-elements) during conversion. +* Option to [show warnings for any unsupported elements](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#show-warning-for-unsupported-elements) during conversion. -## Assemblies and NuGet packages required - -Refer to the following links for assemblies required based on platforms to convert the Word document to PDF. - -* [Word to PDF conversion assemblies](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/assemblies-required-word-to-pdf) -* [Word to PDF conversion NuGet packages](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf) +## Convert Word to PDF -To quickly start converting a Word document to a PDF, please check out this video: -{% youtube "https://www.youtube.com/watch?v=8QdevnBxgHk" %} +The following prerequisites are required before running the code samples in this section: -## Convert Word to PDF +* Create a new .NET console, class library, or web application targeting a supported version of .NET Framework, .NET Core. +* Install the required Syncfusion NuGet packages for your target platform. For details, see [Word to PDF conversion NuGet packages](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/nuget-packages-required-word-to-pdf). The following namespaces are required to compile the code: @@ -47,6 +52,7 @@ N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-plat {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} +using System.IO; using Syncfusion.DocIO; using Syncfusion.DocIO.DLS; using Syncfusion.DocIORenderer; @@ -143,9 +149,9 @@ You can download a complete working sample from [GitHub](https://github.com/Sync T> For troubleshooting issues in the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO), refer [this](https://support.syncfusion.com/kb/article/16012/troubleshooting-guide-for-syncfusion-word-docio-library-issues?isInternalRefresh=False) article that provides comprehensive guidance on resolving common problems. -N> 1. For .NET Framework, creating an instance of the [ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word to PDF. Otherwise, the charts are not preserved in the converted PDF. Whereas this is not necessary for .NET Core, as ChartToImageConverter is initialized internally in Syncfusion.DocIORenderer.Portable assembly. -N> 2. Total number of pages in the converted PDF may vary based on unsupported elements in the input Word document. -N> 3. "DocIO supports Word to PDF conversion in UWP application using DocIORenderer." For further information, please refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp) +N> 1. For .NET Framework, creating an instance of the [ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word to PDF. Otherwise, the charts are not preserved in the converted PDF. Whereas this is not necessary for .NET (Core), as ChartToImageConverter is initialized internally in the Syncfusion.DocIORenderer.Portable assembly. +N> 2. Total number of pages in the converted PDF may vary based on unsupported elements in the input Word document. For more information, refer to the [Limitations in Word to PDF Conversion](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf) page. +N> 3. DocIO supports Word to PDF conversion in UWP applications using DocIORenderer. For further information, refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp). N> 4. Failing to dispose of resources can lead to memory leaks, high memory usage, and performance issues, potentially causing the application to crash. Using **Dispose()** or a **using** statement ensures efficient memory management and keeps the app stable. ## Supported File formats @@ -162,59 +168,59 @@ N> To see limitations and unsupported features in Word to PDF conversion, refer ## Word to PDF conversion in Linux OS -In Linux OS, you can perform the Word to PDF conversion using .NET Core (Targeting .netcoreapp) application. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux). +In Linux OS, you can perform the Word to PDF conversion using a .NET Core application (targeting .NET 8 or later). For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux). -**Frequently Asked Questions** +## Frequently Asked Questions * [How to copy necessary fonts to Linux containers?](https://help.syncfusion.com/document-processing/word/word-library/net/faq#how-to-copy-necessary-fonts-to-linux-containers) * [How to set culture / locale in Docker containers (Windows & Linux containers)?](https://help.syncfusion.com/document-processing/word/word-library/net/faq#how-to-set-culturelocale-in-docker-containers-windows-and-linux-containers) * [How to copy necessary Microsoft compatible fonts to Linux?](https://help.syncfusion.com/document-processing/word/word-library/net/faq#how-to-copy-necessary-microsoft-compatible-fonts-to-linux) -* [How to resolve LibSkiaSharp not found Exception?](https://help.syncfusion.com/document-processing/word/word-library/net/faq#how-to-resolve-libskiasharp-not-found-exception) +* [How to resolve LibSkiaSharp not found exception?](https://help.syncfusion.com/document-processing/word/word-library/net/faq#how-to-resolve-libskiasharp-not-found-exception) ## Customization settings -The Essential® DocIO provides settings while performing Word to PDF conversion mentioned below, +Essential® DocIO provides the following settings to customize Word to PDF conversion. Use these options to control font embedding, accessibility, structure preservation, image handling, conformance, and security in the output PDF. ### Embedding fonts -You can customize the TrueType fonts embedding in two ways as follows: +You can customize the TrueType font embedding in two ways: -* [Embed Subset Fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embed-subset-fonts). -* [Embed Complete Fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embed-complete-fonts). +* [Embed subset fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embed-subset-fonts). +* [Embed complete fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embed-complete-fonts). ### Accessible PDF document -This setting allows you to determine whether to preserve document structured tags in the converted **PDF document for accessibility (508 compliance) support**. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#accessible-pdf-document). +This setting allows you to determine whether to preserve document structured tags in the converted **PDF document for accessibility (Section 508 compliance) support**. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#accessible-pdf-document). ### Word document headings to PDF bookmarks -This setting allows you to determine whether to **preserve Word document headings** (i.e., paragraph with heading style and outline level) as bookmarks in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-headings-to-pdf-bookmarks). +This setting allows you to determine whether to **preserve Word document headings** (i.e., paragraphs with heading style and outline level) as bookmarks in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-headings-to-pdf-bookmarks). -### Word document form field to PDF form field. +### Word document form field to PDF form field -This setting allows you to determine whether to **preserve Word document form fields** (Text form field, Checkbox form field and Drop-down form field) as PDF form fields in the converted PDF document. This features helps in creating fillable PDF forms from Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-form-field-to-pdf-form-field). +This setting allows you to determine whether to **preserve Word document form fields** (text form field, checkbox form field, and drop-down form field) as PDF form fields in the converted PDF document. This feature helps in creating fillable PDF forms from a Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-form-field-to-pdf-form-field). -### Image quality +### Image quality This setting allows you to determine the **quality of the charts and JPEG images** in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#image-quality). -### Recreate Nested Metafile +### Recreate nested metafile This setting allows you to regenerate the nested EMF images present in the Word document during PDF conversion. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#recreate-nested-metafile). -### Identical image optimization +### Identical image optimization -This setting **reduces the Main Memory usage** in Word to PDF conversion by reusing the identical images. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#identical-image-optimization). +This setting **reduces the main memory usage** in Word to PDF conversion by reusing identical images. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#identical-image-optimization). -### PDF Conformance Level +### PDF conformance level This setting allows you to set the PDF conformance level. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#pdf-conformance-level). -### Enable Alternate Chunks +### Enable alternate chunks -In the Word document, another Word documents are embedded in it and referred as AltChunks. This setting allows you to include the alternate chunks while converting Word to PDF conversion. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#enable-alternate-chunks). +In the Word document, other Word documents are embedded and referred to as AltChunks. This setting allows you to include the alternate chunks while converting Word to PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#enable-alternate-chunks). -### Complex Script Text +### Complex script text This setting allows you to preserve the **complex script text** in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#complex-script-text). @@ -228,23 +234,23 @@ You can **preserve revision marks in a generated PDF document** when converting ### Comments in Word-to-PDF conversion -You can **preserve comments balloon in a generated PDF** when converting Word documents with comments. Also you can customize how comments balloon color appears in a generated PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#comments-in-word-to-pdf-conversion). +You can **preserve comment balloons in a generated PDF** when converting Word documents with comments. You can also customize how the comment balloon color appears in a generated PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#comments-in-word-to-pdf-conversion). -### Preserve Ole Equation as bitmap image +### Preserve OLE equation as bitmap image -You can preserve Ole Equation as bitmap image in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#preserve-ole-equation-as-bitmap-image). +You can preserve an OLE equation as a bitmap image in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#preserve-ole-equation-as-bitmap-image). ### Restrict all permission in a PDF document -You can restrict all the permission in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#restrict-all-permission-in-a-pdf-document). +You can restrict all the permissions in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#restrict-all-permission-in-a-pdf-document). -### Apply Matte to Transparent Images +### Apply matte to transparent images This setting allows you to determine whether to **apply a matte color to transparent images** during Word to PDF conversion, ensuring they render cleanly without unwanted borders or artifacts in the final PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#apply-matte-to-transparent-images). -## Font Substitution +## Font substitution -When the necessary fonts used in the Word document has not been installed in the production machine, then Essential® DocIO uses the ”Microsoft Sans Serif” as default font for rendering the text. This leads to preservation difference in generated PDF as each font has different glyphs for characters. +When the necessary fonts used in the Word document have not been installed in the production machine, Essential® DocIO uses "Microsoft Sans Serif" as the default font for rendering the text. This leads to a preservation difference in the generated PDF, as each font has different glyphs for characters. To avoid this, the Essential® DocIO library allows you to set an alternate font for the missing font used in the Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/font-substituion-word-to-pdf). @@ -256,17 +262,19 @@ During Word to PDF conversions, if a glyph of the input text is unavailable in t Refer [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#detailed-limitations) to know about unsupported elements in Word to PDF conversion. -## Show Warning for Unsupported Elements +## Show warning for unsupported elements When converting a Word document to a PDF, the presence of unsupported elements in the input Word document can lead to preservation issues in the converted PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#show-warning-for-unsupported-elements). -## Online Demo +## Online demo + +Explore live demos of Word to PDF conversion using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO): -* Explore how to convert a Word document to PDF using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdf#/tailwind). -* See how to convert a Word document to PDF/UA using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdfua#/tailwind). -* See how to convert a Word document to PDF/A using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdfa#/tailwind). +* [Convert Word to PDF](https://document.syncfusion.com/demos/word/wordtopdf#/tailwind) +* [Convert Word to PDF/UA](https://document.syncfusion.com/demos/word/wordtopdfua#/tailwind) +* [Convert Word to PDF/A](https://document.syncfusion.com/demos/word/wordtopdfa#/tailwind) -## See Also +## See also * [Supported file formats](https://help.syncfusion.com/document-processing/word/word-library/net/support-file-formats) * [How to perform font substitution in Word to PDF conversion](https://support.syncfusion.com/kb/article/7499/how-to-perform-font-substitution-in-winforms-word-to-pdf-conversion) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/overview.md b/Document-Processing/Word/Conversions/Word-To-PDF/overview.md index c7e5b514c0..cc2296dd91 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/overview.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/overview.md @@ -1,6 +1,6 @@ --- title: Convert Word to PDF in Word Library | DocIO | Syncfusion -description: Learn how to convert a Word document to PDF using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. +description: Learn about how to convert a Word document to PDF using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. platform: document-processing control: DocIO documentation: UG @@ -8,14 +8,14 @@ documentation: UG # Convert Word document to PDF using Syncfusion® Word (DocIO) library -The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert Word document to PDF within a few lines of code in .NET applications and also it does not require Adobe and Microsoft Word application to be installed in the machine. Using this, you can create an input Word document from scratch or load an existing Word document and then easily convert to PDF. +The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert a Word document to PDF within a few lines of code in .NET applications and also it does not require Adobe and Microsoft Word applications to be installed on the machine. Using this, you can create an input Word document from scratch or load an existing Word document and then easily convert it to PDF. -The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) to PDF converter offers high versatility and seamless performance across various .NET platforms, including [Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-window-forms), [WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-wpf), [ASP.NET](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net), [ASP.NET MVC](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc), [ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-core), [Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-blazor), [Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-xamarin), [WinUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-winui), [.NET MAUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-maui). Also, in different environments like [Azure](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-azure), [AWS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-aws), [Google Cloud](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-google-cloud-platform), [Linux](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux), [Docker](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-linux-docker), and [macOS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-mac). +The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) PDF converter offers high versatility and seamless performance across various .NET platforms, including [Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-window-forms), [WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-wpf), [ASP.NET](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net), [ASP.NET MVC](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-mvc), [ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-asp-net-core), [Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-blazor), [Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-xamarin), [WinUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-winui), [.NET MAUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-maui). Also, in different environments like [Azure](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-azure), [AWS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-aws), [Google Cloud](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-google-cloud-platform), [Linux](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux), [Docker](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-linux-docker), and [macOS](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-mac). ## Key Features * Ability to [embed fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#embedding-fonts) within the PDF for consistent display. -* Support for converting Word documents to [PDF/UA](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#accessible-pdf-document) (Section 508 compliant). +* Support for converting Word documents to [PDF/UA](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#accessible-pdf-document) (508-compliant). * Support for converting Word documents to [PDF/A](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#pdf-conformance-level) with various PDF conformance levels for long-term archiving and standardization. * Ability to preserve Word document form fields as PDF forms, allowing the creation of [editable PDFs](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-form-field-to-pdf-form-field). * Convert Word headings to [PDF bookmarks](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-headings-to-pdf-bookmarks), generating PDF documents with bookmarks based on Word document paragraph styles and outline levels. @@ -38,7 +38,7 @@ Refer to the following links for assemblies required based on platforms to conve To quickly start converting a Word document to a PDF, please check out this video: {% youtube "https://www.youtube.com/watch?v=8QdevnBxgHk" %} -T> If you encounter issues while using the .NET Word library in ASP.NET Core, refer to the [troubleshooting guide](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues#things-to-check-while-facing-an-issue-in-word-library) for recommended checks and solutions. +T> If you encounter issues while using the .NET Word library in ASP.NET Core, refer to the [Troubleshooting Guide for Word (DocIO)](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues) for recommended checks and solutions. ## Convert Word to PDF @@ -49,6 +49,8 @@ N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-plat {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} +using System; +using System.IO; using Syncfusion.DocIO; using Syncfusion.DocIO.DLS; using Syncfusion.DocIORenderer; @@ -56,6 +58,7 @@ using Syncfusion.Pdf; {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} +using System; using Syncfusion.DocIO; using Syncfusion.DocIO.DLS; using Syncfusion.OfficeChart; @@ -77,6 +80,8 @@ Imports Syncfusion.Pdf The following code example illustrates how to convert a Word document into PDF document. +N> Ensure that the `Template.docx` file is present in the working directory of your application before running the code. + {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/main/Word-to-PDF-Conversion/Convert-Word-document-to-PDF/.NET/Convert-Word-document-to-PDF/Program.cs" %} @@ -139,16 +144,15 @@ wordDocument.Close() By executing the program, you will get the output PDF as follows. -![Word to PDF conversion](NET/WordToPDF_images/OutputImage.png). +![Word to PDF conversion output](NET/WordToPDF_images/OutputImage.png) You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Convert-Word-document-to-PDF). -T> For troubleshooting issues in the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO), refer [this](https://support.syncfusion.com/kb/article/16012/troubleshooting-guide-for-syncfusion-word-docio-library-issues?isInternalRefresh=False) article that provides comprehensive guidance on resolving common problems. -N> 1. For .NET Framework, creating an instance of the [ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word to PDF. Otherwise, the charts are not preserved in the converted PDF. Whereas this is not necessary for .NET Core, as ChartToImageConverter is initialized internally in Syncfusion.DocIORenderer.Portable assembly. -N> 2. Total number of pages in the converted PDF may vary based on unsupported elements in the input Word document. -N> 3. "DocIO supports Word to PDF conversion in UWP application using DocIORenderer." For further information, please refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp) -N> 4. Font-related issues during Word to PDF or image conversion can arise due to missing or incorrect font. For detailed instructions on resolving these problems, refer to this [article](https://support.syncfusion.com/kb/article/13969/how-to-resolve-font-problems-during-word-to-pdf-or-image-conversion). +N> 1. For .NET Framework, creating an instance of the [ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word to PDF. Otherwise, the charts are not preserved in the converted PDF. Whereas this is not necessary for .NET Core, as `ChartToImageConverter` is initialized internally in the `Syncfusion.DocIORenderer.Portable` assembly. +N> 2. The total number of pages in the converted PDF may vary based on the unsupported elements in the input Word document. +N> 3. DocIO supports Word to PDF conversion in UWP applications using `DocIORenderer`. For further information, please refer [here](https://support.syncfusion.com/kb/article/8902/how-to-convert-word-document-to-pdf-in-uwp). +N> 4. Font-related issues during Word to PDF or image conversion can arise due to a missing or incorrect font. For detailed instructions on resolving these problems, refer to this [article](https://support.syncfusion.com/kb/article/13969/how-to-resolve-font-problems-during-word-to-pdf-or-image-conversion). ## Supported File formats @@ -164,7 +168,7 @@ N> To see limitations and unsupported features in Word to PDF conversion, refer ## Word to PDF conversion in Linux OS -In Linux OS, you can perform the Word to PDF conversion using .NET Core (Targeting .netcoreapp) application. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux). +In Linux OS, you can perform the Word to PDF conversion using a .NET Core (Targeting `netcoreapp`) application. Before running the conversion, install the native dependencies required by SkiaSharp and the GDI+ substitute on Linux. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/convert-word-document-to-pdf-in-linux). **Frequently Asked Questions** @@ -192,9 +196,9 @@ This setting allows you to determine whether to preserve document structured tag This setting allows you to determine whether to **preserve Word document headings** (i.e., paragraph with heading style and outline level) as bookmarks in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-headings-to-pdf-bookmarks). -### Word document form field to PDF form field. +### Word document form field to PDF form field -This setting allows you to determine whether to **preserve Word document form fields** (Text form field, Checkbox form field and Drop-down form field) as PDF form fields in the converted PDF document. This features helps in creating fillable PDF forms from Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-form-field-to-pdf-form-field). +This setting allows you to determine whether to **preserve Word document form fields** (Text form field, Checkbox form field and Drop-down form field) as PDF form fields in the converted PDF document. This feature helps in creating fillable PDF forms from a Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#word-document-form-field-to-pdf-form-field). ### Image quality @@ -214,7 +218,7 @@ This setting allows you to set the PDF conformance level. For further informatio ### Enable Alternate Chunks -In the Word document, another Word documents are embedded in it and referred as AltChunks. This setting allows you to include the alternate chunks while converting Word to PDF conversion. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#enable-alternate-chunks). +In a Word document, another Word document is embedded in it and referred to as an AltChunk. This setting allows you to include or exclude alternate chunks while converting Word to PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#enable-alternate-chunks). ### Complex Script Text @@ -222,7 +226,7 @@ This setting allows you to preserve the **complex script text** in the converted ### Hyphenation in Word-to-PDF conversion -Essential® DocIO now allows hyphenating text in a Word document while converting it to PDF format based on the given language dictionaries. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#hyphenation-in-word-to-pdf-conversion). +This setting allows you to hyphenate text in a Word document while converting it to PDF format based on the given language dictionaries. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#hyphenation-in-word-to-pdf-conversion). ### Track changes in Word-to-PDF conversion @@ -230,15 +234,15 @@ You can **preserve revision marks in a generated PDF document** when converting ### Comments in Word-to-PDF conversion -You can **preserve comments balloon in a generated PDF** when converting Word documents with comments. Also you can customize how comments balloon color appears in a generated PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#comments-in-word-to-pdf-conversion). +This setting allows you to **preserve comment balloons in a generated PDF** when converting Word documents with comments. You can also customize how the comment balloon color appears in a generated PDF. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#comments-in-word-to-pdf-conversion). ### Preserve Ole Equation as bitmap image -You can preserve Ole Equation as bitmap image in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#preserve-ole-equation-as-bitmap-image). +This setting allows you to preserve an OLE equation as a bitmap image in the converted PDF document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#preserve-ole-equation-as-bitmap-image). ### Restrict all permission in a PDF document -You can restrict all the permission in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#restrict-all-permission-in-a-pdf-document). +This setting allows you to restrict all the permissions in a PDF document using [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html). For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf-settings#restrict-all-permission-in-a-pdf-document). ### Apply Matte to Transparent Images @@ -246,7 +250,7 @@ This setting allows you to determine whether to **apply a matte color to transpa ## Font Substitution -When the necessary fonts used in the Word document has not been installed in the production machine, then Essential® DocIO uses the ”Microsoft Sans Serif” as default font for rendering the text. This leads to preservation difference in generated PDF as each font has different glyphs for characters. +When a font required by the Word document has not been installed on the production machine, Essential® DocIO uses "Microsoft Sans Serif" as the default font for rendering the text. This leads to preservation differences in the generated PDF, as each font has different glyphs for characters. To avoid this, the Essential® DocIO library allows you to set an alternate font for the missing font used in the Word document. For further information, click [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/font-substituion-word-to-pdf). @@ -256,7 +260,7 @@ During Word to PDF conversions, if a glyph of the input text is unavailable in t ## Unsupported elements in Word to PDF conversion -Refer [here](document-processing/word/conversions/word-to-pdf/net/limitations-word-to-pdf) to know about unsupported elements in Word to PDF conversion. +Refer [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf) to know about unsupported elements in Word to PDF conversion. ## Show Warning for Unsupported Elements @@ -264,9 +268,9 @@ When converting a Word document to a PDF, the presence of unsupported elements i ## Online Demo -* Explore how to convert a Word document to PDF using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdf#/tailwind). -* See how to convert a Word document to PDF/UA using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdfua#/tailwind). -* See how to convert a Word document to PDF/A using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtopdfa#/tailwind). +* Convert a Word document to PDF using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) — [live demo](https://document.syncfusion.com/demos/word/wordtopdf#/tailwind). +* Convert a Word document to PDF/UA for accessibility (508 compliance) using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) — [live demo](https://document.syncfusion.com/demos/word/wordtopdfua#/tailwind). +* Convert a Word document to PDF/A for long-term archiving using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) — [live demo](https://document.syncfusion.com/demos/word/wordtopdfa#/tailwind). ## See Also diff --git a/Document-Processing/Word/Conversions/html-conversions.md b/Document-Processing/Word/Conversions/html-conversions.md index e479a33d65..32b07cca20 100644 --- a/Document-Processing/Word/Conversions/html-conversions.md +++ b/Document-Processing/Word/Conversions/html-conversions.md @@ -65,11 +65,11 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ### XHTML Validation -Every HTML content is validated against a Document Type Declaration (DTD) which is a set of mark-up declarations that define a document type for a SGML-family mark-up language (GML, SGML, XML, HTML). +All HTML content is validated against a Document Type Declaration (DTD), which is a set of markup declarations that define a document type for an SGML-family markup language (GML, SGML, XML, HTML). #### XHTML validation types -The following XHTML validation types are supported in Essential® DocIO while importing an HTML content. +The following XHTML validation types are supported in Essential® DocIO while importing HTML content. @@ -88,16 +88,16 @@ The following XHTML validation types are supported in Essential® - +
XHTMLValidationType.StrictIt does not allows the attributes inside the tag.It does not allow the attributes inside the tag.
### Customizing the HTML to Word conversion -The Essential® DocIO provides settings while performing HTML to Word conversion as mentioned as follows: +The Essential® DocIO provides settings while performing HTML to Word conversion as follows: * Validate the HTML string against XHTML 1.0 Strict and Transitional schema. -* Insert the HTML string at the specified position of the document body contents. +* Insert the HTML string at the specified position of the document body. * Append HTML string to the specified paragraph. The following code example shows how to customize the HTML to Word conversion. @@ -155,9 +155,9 @@ Dim document As New WordDocument("Template.docx") 'Html string to be inserted Dim htmlstring As String = "

This text is inserted as HTML string.

" 'Validates the Html string -Dim isValidHtmlAs Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional) +Dim isValidHtml As Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional) 'When the Html string passes validation, it is inserted to document -If isValidHtmlThen +If isValidHtml Then 'Appends Html string as first item of the second paragraph in the document document.Sections(0).Body.InsertXHTML(htmlstring, 2, 0) 'Appends the Html string to first paragraph in the document @@ -172,11 +172,9 @@ document.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/HTML-conversions/Customize-HTML-to-Word-conversion). -N> 1. Inserting XHTML string is not supported in Silverlight, Windows Phone, and Xamarin applications. -N> 2. XHTML validation against XHTML 1.0 Strict and Transitional schema is not supported in Windows Store applications. -N> 3. [XHTMLValidationType.None](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.XHTMLValidationType.html): Default validation while importing HTML file. -N> 4. [XHTMLValidationType.None](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.XHTMLValidationType.html): Validates the HTML file against XHTML format and it doesn't perform any schema validation. -N> 5. From version 27.X.X, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) supports opening HTML even if it contains improper closing tags when validation is set to None. +N> 1. Inserting XHTML string is not supported in Xamarin applications. +N> 2. [XHTMLValidationType.None](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.XHTMLValidationType.html) is the default validation while importing an HTML file. It validates the HTML against the XHTML format but does not perform any schema validation. +N> 3. From version 27.1.X, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) supports opening HTML even if it contains improper closing tags when validation is set to None. ### Customize image data @@ -188,21 +186,20 @@ The following code example shows how to load image data based on image source pa {% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/main/HTML-conversions/Customize-image-data/.NET/Customize-image-data/Program.cs" %} //Open the file as Stream -FileStream docStream = new FileStream("Input.html", FileMode.Open, FileAccess.Read); //Creates a new instance of WordDocument -WordDocument document = new WordDocument(); -//Hooks the ImageNodeVisited event to open the image from a specific location -document.HTMLImportSettings.ImageNodeVisited += OpenImage; -//Opens the input HTML document -document.Open(docStream, FormatType.Html); -//Unhooks the ImageNodeVisited event after loading HTML -document.HTMLImportSettings.ImageNodeVisited -= OpenImage; -//Creates an instance of memory stream -//Saves the Word document to MemoryStream -MemoryStream stream = new MemoryStream(); -document.Save(stream, FormatType.Docx); -//Closes the WordDocument instance -document.Close(); +using (WordDocument document = new WordDocument()) +{ + //Hooks the ImageNodeVisited event to open the image from a specific location + document.HTMLImportSettings.ImageNodeVisited += OpenImage; + //Opens the input HTML document + document.Open("Input.html", FormatType.Html); + //Unhooks the ImageNodeVisited event after loading HTML + document.HTMLImportSettings.ImageNodeVisited -= OpenImage; + //Saves the Word document + document.Save("HtmlToWord.docx", FormatType.Docx); + //Closes the WordDocument instance + document.Close(); +} {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} @@ -274,7 +271,7 @@ N> Calling the above event is mandatory in ASP.NET Core, UWP, and Xamarin platfo * [How to get image from URL while opening HTML in .NET Core targeting applications?](https://www.syncfusion.com/kb/13053/how-to-get-image-from-url-while-opening-html-in-asp-net-core) -### Supported CSS Selector in DocIO +### Supported CSS Selectors in DocIO CSS selectors are used to select the HTML elements you want to style and apply a set of CSS rules. @@ -478,7 +475,7 @@ document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css" 'Export the Word document image as Base-64 embedded image document.SaveOptions.HTMLExportImageAsBase64 = True 'Set value to omit XML declaration in the exported html file. -document.SaveOptions.HtmlExportOmitXmlDeclaration = True; +document.SaveOptions.HtmlExportOmitXmlDeclaration = True 'Saves the document as html file export.SaveAsXhtml(document, "WordtoHtml.html") document.Close() @@ -619,8 +616,8 @@ using (FileStream fileStreamPath = new FileStream("Input.docx", FileMode.Open, F WordDocument document = new WordDocument("Input.docx", FormatType.Docx); //Enable the flag, to save HTML with elements inside body tags alone. document.SaveOptions.HtmlExportBodyContentAlone = true; -//Saves the document as html file -document.Save(document, "WordtoHtml.html"); +//Saves the document as HTML file +document.Save("WordtoHtml.html", FormatType.Html); document.Close(); {% endhighlight %} @@ -628,9 +625,9 @@ document.Close(); 'Loads an existing document Dim document As New WordDocument("Input.docx") 'Enable the flag, to save HTML with elements inside body tags alone. -document.SaveOptions.HtmlExportBodyContentAlone = true -'Saves the document as html file -document.Save(document, "WordtoHtml.html") +document.SaveOptions.HtmlExportBodyContentAlone = True +'Saves the document as HTML file +document.Save("WordtoHtml.html", FormatType.Html) document.Close() {% endhighlight %} @@ -1385,8 +1382,7 @@ Underline types and colors are ignored. * [How to convert HTML document to plain text in C# and VB.NET](https://www.syncfusion.com/kb/13194/how-to-convert-html-document-to-plain-text-in-c-and-vb-net) * [How to save images into a folder and use that path in Word to HTML?](https://www.syncfusion.com/kb/13949/how-to-save-images-into-a-folder-and-use-that-path-in-word-to-html) * [How to replace text in a list paragraph with an HTML string in a Word document?](https://support.syncfusion.com/kb/article/17674/how-to-replace-text-in-a-list-paragraph-with-an-html-string-in-a-word-document) -* [How to convert Webpage to Word document using C#?](https://support.syncfusion.com/kb/article/17771/how-to-convert-webpage-to-word-document-using-c) -* [How to merge header, body and footer from different HTML files into a Word document?](https://support.syncfusion.com/kb/article/17771/how-to-convert-webpage-to-word-document-using-c) +* [How to merge header, body and footer from different HTML files into a Word document?](https://support.syncfusion.com/kb/article/17771/how-to-convert-a-webpage-to-a-word-document-using-c-in-net-core) * [How to add numbers on pages in HTML to PDF in ASP.NET DocIO?](https://support.syncfusion.com/kb/article/19446/how-to-add-numbers-on-pages-in-html-to-pdf-in-aspnet-docio?isInternalRefresh=False) * [How to restart numbering when replacing multiple texts with the same HTML list in Word document?](https://support.syncfusion.com/kb/article/19665/how-to-restart-numbering-when-replacing-multiple-texts-with-the-same-html-list-in-word-document) * [How to export content between two bookmarks as HTML in a Word document?](https://support.syncfusion.com/kb/article/20097/how-to-export-content-between-two-bookmarks-as-html-in-a-word-document) diff --git a/Document-Processing/Word/Conversions/markdown-to-word-conversion.md b/Document-Processing/Word/Conversions/markdown-to-word-conversion.md index 6903a2b357..9bc267e59a 100644 --- a/Document-Processing/Word/Conversions/markdown-to-word-conversion.md +++ b/Document-Processing/Word/Conversions/markdown-to-word-conversion.md @@ -8,9 +8,9 @@ documentation: UG # Markdown to Word Conversion -Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word (DocIO) library supports the conversion of Markdown to Word document and vice versa, which mostly follows the CommonMark specification and GitHub-flavored syntax. +Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word (DocIO) library supports converting Markdown files to Word documents, which mostly follows the CommonMark specification and GitHub-flavored syntax. -To quickly start converting a Word document to Markdown and vice versa, please check out this video: +To quickly start converting a Markdown file to a Word document, check out this video: {% youtube "https://www.youtube.com/watch?v=7iMVgVKXRdU" %} ## Assemblies and NuGet packages required @@ -22,9 +22,15 @@ Refer to the following links for assemblies and NuGet packages required based on ## Convert Markdown to Word document -Convert an existing markdown file to a Word document (DOC, DOCX and RTF) using the .NET Word (DocIO) library. +Convert an existing markdown file to a Word document (DOC, DOCX, or RTF) using the .NET Word (DocIO) library. -The following code example shows how to convert Markdown to Word document. +The following code example shows how to convert a Markdown file to a Word document. Add the required `using` directives to your source file: + +```csharp +using System.IO; +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +``` N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. @@ -62,15 +68,27 @@ You can download a complete working sample from [GitHub](https://github.com/Sync T> You can also save the markdown file as [HTML](https://help.syncfusion.com/document-processing/word/word-library/net/html), [PDF](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/word-to-pdf), and [Image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image). -N> 1. Hook the event handler before opening a Word document as per the above code example. -N> 2. In Markdown to Word conversion, SVG or invalid images are replaced with a red "X" image instead of the original image. +N> In Markdown to Word conversion, SVG or invalid images are replaced with a red "X" image instead of the original image. -## MdImport Setting +## Markdown Import Settings When opening an existing Markdown document, the .NET Word (DocIO) library provides custom import settings through the **MdImportSettings** property. This allows you to customize how the Markdown content is parsed and imported. +The following properties are available on `MdImportSettings`: + +| Property | Description | +| --- | --- | +| `ImageNodeVisited` | An event raised for each image encountered while importing. Use it to load image data from a custom source. | +| `Encoding` | The character encoding used to read the Markdown file. Defaults to `Encoding.UTF8`. | + ### Customize image data -The .NET Word (DocIO) library provides a [ImageNodeVisited](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.SaveOptions.html#Syncfusion_DocIO_DLS_SaveOptions_ImageNodeVisited) event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this [ImageNodeVisited](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.SaveOptions.html#Syncfusion_DocIO_DLS_SaveOptions_ImageNodeVisited) event. + +The .NET Word (DocIO) library provides an [ImageNodeVisited](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.SaveOptions.html#Syncfusion_DocIO_DLS_SaveOptions_ImageNodeVisited) event that customizes image data while importing a Markdown file. Handle this event to load image data from a custom source. + +The `ImageNodeVisited` event provides an `MdImageNodeVisitedEventArgs` object with the following members: + +* `Uri` — the image source declared in the Markdown (file name, relative path, or URL). +* `ImageStream` — the stream to populate. The library reads from this stream when inserting the image into the Word document. The following code example shows how to load image data based on the image source path when importing the Markdown files. @@ -131,12 +149,12 @@ private static void MdImportSettings_ImageNodeVisited(object sender, Syncfusion. //Retrieve the image from the website and use it. else if (args.Uri.StartsWith("https://")) { - WebClient client = new WebClient(); //Download the image as a stream. - byte[] image = client.DownloadData(args.Uri); - Stream stream = new MemoryStream(image); - //Set the retrieved image from the input Markdown. - args.ImageStream = stream; + using (HttpClient client = new HttpClient()) + { + byte[] image = client.GetByteArrayAsync(args.Uri).GetAwaiter().GetResult(); + args.ImageStream = new MemoryStream(image); + } } } {% endhighlight %} @@ -152,12 +170,12 @@ private static void MdImportSettings_ImageNodeVisited(object sender, Syncfusion. //Retrieve the image from the website and use it. else if (args.Uri.StartsWith("https://")) { - WebClient client = new WebClient(); //Download the image as a stream. - byte[] image = client.DownloadData(args.Uri); - Stream stream = new MemoryStream(image); - //Set the retrieved image from the input Markdown. - args.ImageStream = stream; + using (HttpClient client = new HttpClient()) + { + byte[] image = client.GetByteArrayAsync(args.Uri).GetAwaiter().GetResult(); + args.ImageStream = new MemoryStream(image); + } } } {% endhighlight %} @@ -171,25 +189,24 @@ Private Shared Sub MdImportSettings_ImageNodeVisited(ByVal sender As Object, ByV args.ImageStream = New FileStream("Image_2.png", FileMode.Open) 'Retrieve the image from the website and use it. ElseIf args.Uri.StartsWith("https://") Then - Dim client As WebClient = New WebClient() 'Download the image as a stream. - Dim image As Byte() = client.DownloadData(args.Uri) - Dim stream As Stream = New MemoryStream(image) - 'Set the retrieved image from the input Markdown. - args.ImageStream = stream + Using client As New HttpClient() + Dim image As Byte() = client.GetByteArrayAsync(args.Uri).GetAwaiter().GetResult() + args.ImageStream = New MemoryStream(image) + End Using End If End Sub {% endhighlight %} {% endtabs %} -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Markdown-to-Word-conversion/Customize-image). +N> Hook the event handler before opening the Markdown file, as shown in the previous code example. Stream instances assigned to `args.ImageStream` are not disposed by DocIO; dispose of them yourself when you no longer need the image data. -N> Hook the event handler before opening a Word document as per the above code example. +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Markdown-to-Word-conversion/Customize-image). ### Encoding -The .NET Word (DocIO) library provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, ASCII, or other encodings. +The .NET Word (DocIO) library provides an `Encoding` property to specify the character encoding to use when opening a Markdown file. This property is useful when you need to open Markdown files that are saved with specific character encodings such as UTF-8, UTF-16, or ASCII. The default value is `Encoding.UTF8`. The following code example shows how to open a Markdown file with a specific encoding. @@ -200,7 +217,7 @@ The following code example shows how to open a Markdown file with a specific enc using (WordDocument document = new WordDocument()) { //Set the encoding for the Markdown file. - document.MdImportSettings.Encoding = Encoding.UTF8; + document.MdImportSettings.Encoding = System.Text.Encoding.UTF8; //Open the Markdown file. document.Open(Path.GetFullPath("Data/Input.md")); //Save as a Word document. @@ -213,7 +230,7 @@ using (WordDocument document = new WordDocument()) using (WordDocument document = new WordDocument()) { //Set the encoding for the Markdown file. - document.MdImportSettings.Encoding = Encoding.UTF8; + document.MdImportSettings.Encoding = System.Text.Encoding.UTF8; //Open the Markdown file. document.Open("Input.md"); //Save as a Word document. @@ -225,7 +242,7 @@ using (WordDocument document = new WordDocument()) 'Create a Word document instance. Using document As WordDocument = New WordDocument() 'Set the encoding for the Markdown file. - document.MdImportSettings.Encoding = Encoding.UTF8 + document.MdImportSettings.Encoding = System.Text.Encoding.UTF8 'Open the Markdown file. document.Open("Input.md") 'Save as a Word document. @@ -235,22 +252,16 @@ End Using {% endtabs %} -N> Provide the encoding values before opening a Word document as per the above code example. +N> Provide the encoding value before opening the Markdown file, as shown in the above code example. ## Supported Markdown Syntax - +
- - - + + + @@ -271,7 +282,7 @@ N> Provide the encoding values before opening a Word document as per the above c

Sample content for *Italic text*.

@@ -282,7 +293,7 @@ N> Provide the encoding values before opening a Word document as per the above c

Sample content for ***bold and Italic text***.

@@ -293,12 +304,12 @@ N> Provide the encoding values before opening a Word document as per the above c

Sample content for ~~strike through text~~.

@@ -337,7 +348,7 @@ N> Provide the encoding values before opening a Word document as per the above c

##Heading 2 content

@@ -348,7 +359,7 @@ N> Provide the encoding values before opening a Word document as per the above c

###Heading 3 content

@@ -359,7 +370,7 @@ N> Provide the encoding values before opening a Word document as per the above c

####Heading 4 content

@@ -370,7 +381,7 @@ N> Provide the encoding values before opening a Word document as per the above c

#####Heading 5 content

@@ -381,7 +392,7 @@ N> Provide the encoding values before opening a Word document as per the above c

######Heading 6 content

@@ -392,7 +403,7 @@ N> Provide the encoding values before opening a Word document as per the above c

>Block quotes text

@@ -403,7 +414,7 @@ N> Provide the encoding values before opening a Word document as per the above c

`Code span text`

@@ -414,7 +425,7 @@ N> Provide the encoding values before opening a Word document as per the above c

4 spaces

@@ -425,7 +436,7 @@ N> Provide the encoding values before opening a Word document as per the above c

```
Multi line code text
Multi line code text
```

@@ -436,7 +447,7 @@ N> Provide the encoding values before opening a Word document as per the above c

1. First
2. Second

@@ -447,7 +458,7 @@ N> Provide the encoding values before opening a Word document as per the above c

- First
- second

@@ -455,10 +466,10 @@ N> Provide the encoding values before opening a Word document as per the above c

Links

@@ -467,10 +478,9 @@ N> Provide the encoding values before opening a Word document as per the above c @@ -481,7 +491,7 @@ N> Provide the encoding values before opening a Word document as per the above c

--- (three hyphen characters)

@@ -492,8 +502,8 @@ N> Provide the encoding values before opening a Word document as per the above c

![Alternate text] (URL path)

@@ -516,4 +526,5 @@ N> Provide the encoding values before opening a Word document as per the above c ## See Also +* [Convert Word document to Markdown in C#](word-to-markdown-conversion) * [How to change the image size during Markdown to Word conversion](https://support.syncfusion.com/kb/article/17707/how-to-change-the-image-size-during-markdown-to-word-conversion) diff --git a/Document-Processing/Word/Conversions/overview.md b/Document-Processing/Word/Conversions/overview.md index 409a189c6c..93ad6294ca 100644 --- a/Document-Processing/Word/Conversions/overview.md +++ b/Document-Processing/Word/Conversions/overview.md @@ -1,6 +1,6 @@ --- title: Word Document Conversion Library | Syncfusion -description: The .NET Word Conversion Library converts Word to several file formats like PDF, image, HTML, RTF, ODT, Markdown, Text without Microsoft Office dependencies. +description: Convert Word documents to PDF, Image, HTML, RTF, ODT, Markdown, and Text — and back — using the .NET Word Conversion Library without Microsoft Office. platform: document-processing control: general documentation: UG @@ -29,7 +29,7 @@ keywords: Word, SDK, Automation, API, convert {% doccard text="Word to EPUB" link="/document-processing/word/conversions/word-to-epub-conversion" icon="/document-processing/word/conversions/images/Word to EPUB.svg" %} -{% doccard text="Word File Formats Conversions" link="/document-processing/word/conversions/word-file-formats-conversions" icon="/document-processing/word/conversions/images/Conversions.svg" %} +{% doccard text="Word File Format Conversions" link="/document-processing/word/conversions/word-file-formats-conversions" icon="/document-processing/word/conversions/images/Conversions.svg" %} {% enddoccards %} diff --git a/Document-Processing/Word/Conversions/rtf-conversions.md b/Document-Processing/Word/Conversions/rtf-conversions.md index 87ccf113fa..d1a9169ac6 100644 --- a/Document-Processing/Word/Conversions/rtf-conversions.md +++ b/Document-Processing/Word/Conversions/rtf-conversions.md @@ -1,6 +1,6 @@ --- -title: RTF conversions in C# | DocIO | Syncfusion -description: Learn how to convert Word document to RTF and vice versa using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. +title: RTF conversions in C#| DocIO | Syncfusion +description: Learn how to convert a Word document to RTF and vice versa using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. platform: document-processing control: DocIO documentation: UG @@ -9,16 +9,18 @@ documentation: UG # RTF Conversions in Word Library ## RTF -The [Rich Text Format (RTF)](https://en.wikipedia.org/wiki/Rich_Text_Format) is one of the document formats supported by Microsoft Word and many other Word processing applications. RTF is human readable file format invented for interchanging formatted text between applications. It is an optional format for Word that retains most formatting and all content of the original document. +The [Rich Text Format (RTF)](https://en.wikipedia.org/wiki/Rich_Text_Format) is one of the document formats supported by Microsoft Word and many other Word processing applications. RTF is a human-readable file format designed to interchange formatted text between applications. It is an optional format for Word that retains most formatting and all content of the original document. -Most of the Word processors (including Microsoft Word) uses the XML-based file formats, Microsoft has discontinued enhancements to the RTF and still supporting it. The last version was 1.9.1 released in 2008. +Most word processors (including Microsoft Word) use XML-based file formats. Microsoft has discontinued enhancements to RTF but still supports it. The last version was 1.9.1, released in 2008. To quickly start converting a Word document to RTF and vice versa, please check out this video: {% youtube "https://www.youtube.com/watch?v=U5JRWJ42U3s" %} -## Assemblies and NuGet packages required +## Prerequisites -Refer to the following links for assemblies and NuGet packages required based on platforms to convert the RTF document into Word document and vice versa using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). +### Assemblies and NuGet packages + +Refer to the following links for assemblies and NuGet packages required based on platforms to convert an RTF document into a Word document and vice versa using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). * [RTF conversions assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required) * [RTF conversions NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required) @@ -44,27 +46,32 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Rtf)) {% highlight c# tabtitle="C# [Windows-specific]" %} //Loads an existing document -WordDocument document = new WordDocument("Input.rtf", FormatType.Rtf); -//Saves the Word document as RTF file -document.Save("RtfToWord.docx", FormatType.Docx); -//Closes the document -document.Close(); +using (WordDocument document = new WordDocument("Input.rtf", FormatType.Rtf)) +{ + //Saves the Word document as DOCX file + document.Save("RtfToWord.docx", FormatType.Docx); + //Closes the document + document.Close(); +} {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads an existing document -Dim document As New WordDocument("Input.rtf", FormatType.Rtf) -'Saves the Word document as RTF file -document.Save("RtfToWord.docx", FormatType.Docx) -'Closes the document -document.Close() +Using document As New WordDocument("Input.rtf", FormatType.Rtf) + 'Saves the Word document as DOCX file + document.Save("RtfToWord.docx", FormatType.Docx) + 'Closes the document + document.Close() +End Using {% endhighlight %} {% endtabs %} You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/RTF-conversions/Convert-RTF-to-Word). -The following code example shows how to convert Word document into RTF document. +## Convert Word to RTF + +The following code example shows how to convert a Word document into an RTF document using the `FormatType.Rtf` save option. {% tabs %} @@ -83,20 +90,23 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) {% highlight c# tabtitle="C# [Windows-specific]" %} //Loads an existing document -WordDocument document = new WordDocument("Template.docx", FormatType.Docx); -//Saves the Word document as RTF file -document.Save("WordToRtf.rtf", FormatType.Rtf); -//Closes the document -document.Close(); +using (WordDocument document = new WordDocument("Template.docx", FormatType.Docx)) +{ + //Saves the Word document as RTF file + document.Save("WordToRtf.rtf", FormatType.Rtf); + //Closes the document + document.Close(); +} {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads an existing document -Dim document As New WordDocument("Template.docx", FormatType.Docx) -'Saves the Word document as RTF file -document.Save("WordToRtf.rtf", FormatType.Rtf) -'Closes the document -document.Close() +Using document As New WordDocument("Template.docx", FormatType.Docx) + 'Saves the Word document as RTF file + document.Save("WordToRtf.rtf", FormatType.Rtf) + 'Closes the document + document.Close() +End Using {% endhighlight %} {% endtabs %} @@ -104,12 +114,12 @@ document.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/RTF-conversions/Convert-Word-to-RTF). ## Supported and Unsupported features -The supported and unsupported features of DocIO based on file formats can be referred [here](https://help.syncfusion.com/document-processing/word/word-library/net/supported-and-unsupported-features) +Refer to the following link for supported and unsupported features of DocIO by file format: [Supported and Unsupported features](https://help.syncfusion.com/document-processing/word/word-library/net/supported-and-unsupported-features). ## Online Demo -* Explore how to convert the RTF file to Word document using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/rtftodoc#/tailwind). -* See how to convert a Word document to an RTF file using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) in a live demo [here](https://document.syncfusion.com/demos/word/wordtortf#/tailwind). +* Explore the [RTF to Word live demo](https://document.syncfusion.com/demos/word/rtftodoc#/tailwind) to see how to convert an RTF file to a Word document using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). +* See the [Word to RTF live demo](https://document.syncfusion.com/demos/word/wordtortf#/tailwind) to see how to convert a Word document to an RTF file using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). ## See Also diff --git a/Document-Processing/Word/Conversions/text-conversions.md b/Document-Processing/Word/Conversions/text-conversions.md index 51838e3d4a..aa8e47ec7e 100644 --- a/Document-Processing/Word/Conversions/text-conversions.md +++ b/Document-Processing/Word/Conversions/text-conversions.md @@ -6,27 +6,29 @@ control: DocIO documentation: UG --- -# Text Conversions in Word Library +# Convert Word to Text Document and Vice Versa -The Essential® DocIO converts the Word document into Text file and vice versa. +The Essential® DocIO converts a Word document to a Text file and vice versa without Microsoft Word or interop dependencies. To quickly start converting a Word document to Text and vice versa, please check out this video: {% youtube "https://www.youtube.com/watch?v=sK71TfWEtk8" %} ## Convert Word to Text -The following code example shows how to convert the Word document into text file. +The following code example shows how to convert a Word document into a text file. N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. +N> The output text file contains only the textual content of the Word document. Document formatting such as bold, italics, lists, tables, and images is not preserved in the text file. For full-fidelity conversion, consider Word-to-PDF or Word-to-DOCX. + {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/main/Text-file-conversion/Convert-Word-to-text-file/.NET/Convert-Word-to-text-file/Program.cs" %} -FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); -//Opens an existing document from file system through constructor of WordDocument class +//Opens an existing document from the file system through the constructor of the WordDocument class +using (FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) { - //Saves the Word document to MemoryStream + //Saves the Word document to a MemoryStream MemoryStream stream = new MemoryStream(); document.Save(stream, FormatType.Txt); //Closes the Word document @@ -37,16 +39,16 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) {% highlight c# tabtitle="C# [Windows-specific]" %} //Loads a template document WordDocument document = new WordDocument("Template.docx"); -//Saves the document as text file +//Saves the document as a text file document.Save("WordToText.txt", FormatType.Txt); //Closes the document document.Close(); {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -'Loads a text file +'Loads a Word document Dim document As New WordDocument("Template.docx") -'Saves the document as text file +'Saves the document as a text file document.Save("WordToText.txt", FormatType.Txt) 'Closes the document document.Close() @@ -58,7 +60,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Convert Text to Word -The following code example shows how to convert a Text file into Word document. +The following code example shows how to convert a Text file into a Word document. {% tabs %} @@ -78,7 +80,7 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Txt)) {% highlight c# tabtitle="C# [Windows-specific]" %} //Loads a text file WordDocument document = new WordDocument("Template.txt"); -//Saves the document as text file +//Saves the document as a Word document document.Save("TextToWord.docx", FormatType.Docx); //Closes the document document.Close(); @@ -87,7 +89,7 @@ document.Close(); {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads a text file Dim document As New WordDocument("Template.txt") -'Saves the document as text file +'Saves the document as a Word document document.Save("TextToWord.docx", FormatType.Docx) 'Closes the document document.Close() @@ -97,7 +99,11 @@ document.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Text-file-conversion/Convert-text-file-to-Word). -The following code example shows how to retrieve the Word document contents as a plain text. +## Retrieve Word Document as Plain Text + +The following code example shows how to retrieve the textual contents of a Word document and place them into a new Word document. This is useful when you need to strip out section breaks, page breaks, and other non-textual elements while keeping the content editable. + +N> `document.GetText()` returns the document's content as a `string` that may include section breaks, paragraph marks, and other control characters. If you only need the visible text, iterate the body items (sections, paragraphs, tables) and concatenate the inner text instead. {% tabs %} @@ -108,15 +114,15 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) { //Gets the document text string text = document.GetText(); - //Creates new Word document + //Creates a new Word document WordDocument newdocument = new WordDocument(); - //Adds new section + //Adds a new section IWSection section = newdocument.AddSection(); - //Adds new paragraph + //Adds a new paragraph IWParagraph paragraph = section.AddParagraph(); //Appends the text to the paragraph paragraph.AppendText(text); - //Saves the Word document to MemoryStream + //Saves the new Word document to a MemoryStream MemoryStream stream = new MemoryStream(); newdocument.Save(stream, FormatType.Docx); //Closes the Word document @@ -130,16 +136,16 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) WordDocument document = new WordDocument("Template.docx"); //Gets the document text string text = document.GetText(); -//Creates new Word document +//Creates a new Word document WordDocument newdocument = new WordDocument(); -//Adds new section +//Adds a new section IWSection section = newdocument.AddSection(); -//Adds new paragraph +//Adds a new paragraph IWParagraph paragraph = section.AddParagraph(); //Appends the text to the paragraph paragraph.AppendText(text); //Saves and closes the document -newdocument.Save("Sample.docx"); +newdocument.Save("Sample.docx", FormatType.Docx); newdocument.Close(); document.Close(); {% endhighlight %} @@ -149,16 +155,16 @@ document.Close(); Dim document As New WordDocument("Template.docx") 'Gets the document text Dim text As String = document.GetText() -'Creates new Word document +'Creates a new Word document Dim newdocument As New WordDocument() -'Adds new section +'Adds a new section Dim section As IWSection = newdocument.AddSection() -'Adds new paragraph +'Adds a new paragraph Dim paragraph As IWParagraph = section.AddParagraph() 'Appends the text to the paragraph paragraph.AppendText(text) 'Saves and closes the document -newdocument.Save("Sample.docx") +newdocument.Save("Sample.docx", FormatType.Docx) newdocument.Close() document.Close() {% endhighlight %} @@ -169,4 +175,4 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## See Also -* [How to convert text file to RTF in .NET?](https://support.syncfusion.com/kb/article/22691/how-to-convert-text-file-to-rtf-in-net) +* [How to convert text file to RTF in .NET?](https://support.syncfusion.com/kb/article/22691/how-to-convert-text-file-to-rtf-in-net) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/word-file-formats-conversions.md b/Document-Processing/Word/Conversions/word-file-formats-conversions.md index e548dd8c12..7c4d00e7bc 100644 --- a/Document-Processing/Word/Conversions/word-file-formats-conversions.md +++ b/Document-Processing/Word/Conversions/word-file-formats-conversions.md @@ -1,6 +1,6 @@ --- title: Word file format conversions in C# | DocIO | Syncfusion -description: Learn about the supported Word file format conversions such a Word open XML formats, Word processing XML, and Word binary in the .NET Word library. +description: Learn about the supported Word file format conversions such as Word Open XML formats, WordprocessingML, and Word binary in the .NET Word library. platform: document-processing control: DocIO documentation: UG @@ -38,7 +38,7 @@ Click [here](https://help.syncfusion.com/document-processing/word/word-library/n DOTX is a Word document template. Templates are useful when you regularly produce similar types of documents, as they let you start from a ready-made structure instead of building the document from scratch each time. -The following code example illustrates how to create the Word document template with a few lines of code. +The following code example illustrates how to create a Word document template with a few lines of code. N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. @@ -100,10 +100,10 @@ For further information, click [here](https://help.syncfusion.com/document-proce Word Processing XML (WordML) is a single‑file XML format introduced in Microsoft Word 2003 to represent Word document content in XML. -The Essential® DocIO supports converting the Word document into Word Processing XML document and vice versa. +Essential® DocIO supports converting Word documents into Word Processing XML and back. -N> 1. Importing and exporting Word Processing 2007 XML documents is supported. -N> 2. Exporting Word Processing 2003 XML documents is not supported. However, you can import Word Processing 2003 XML documents and export them to other supported file formats. +N> 1. Word Processing 2007 XML documents can be both imported and exported. +N> 2. Word Processing 2003 XML documents cannot be exported. However, you can import Word Processing 2003 XML documents and export them to other supported file formats. N> 3. Custom XML elements present in Word Processing 2003 XML documents are removed automatically during import, similar to the behavior of recent versions of Microsoft Word. Custom XML elements are a deprecated feature in newer Word versions. ### Word to WordML @@ -190,7 +190,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ### Supported elements in Word Processing XML conversion -Word Processing XML conversion supports all common Word document elements such as paragraphs, text, tables, images, and other standard formatting elements. The following table highlights the support status of specific elements that may have limitations or behavior differences during conversion. +Word Processing XML conversion supports all common Word document elements such as paragraphs, text, tables, images, and other standard formatting elements. The following table summarizes the element-level support for the Word-to-WordML and WordML-to-Word conversions covered above, and flags elements that have limitations or behavior differences.
-

Element

-
-

Syntax

-
-

Description

-
ElementSyntaxDescription
@@ -260,7 +271,7 @@ N> Provide the encoding values before opening a Word document as per the above c

Sample content for **bold text**.

-

For bold, add ** to front and back of the text.

+

For bold, add ** to the front and back of the text.

-

For Italic, add * to front and back of the text.

+

For italic, add * to the front and back of the text.

-

For bold and Italics, add *** to the front and back of the text.

+

For bold and italics, add *** to the front and back of the text.

-

For strike through, add ~~ to front and back of the text.

+

For strikethrough, add ~~ to the front and back of the text.

-

Subscript

+

Subscript (HTML)

<sub>Subscript text</sub>

@@ -309,7 +320,7 @@ N> Provide the encoding values before opening a Word document as per the above c
-

Superscript

+

Superscript (HTML)

<sup>Superscript text</sup>

@@ -326,7 +337,7 @@ N> Provide the encoding values before opening a Word document as per the above c

#Heading 1 content

-

For heading 1, add # to start of the line.

+

For heading 1, add # to the start of the line.

-

For heading 2, add ## to start of the line.

+

For heading 2, add ## to the start of the line.

-

For heading 3, add ### to start of the line.

+

For heading 3, add ### to the start of the line.

-

For heading 4, add #### to start of the line.

+

For heading 4, add #### to the start of the line.

-

For heading 5, add ##### to start of the line.

+

For heading 5, add ##### to the start of the line.

-

For heading 6, add ###### to start of the line.

+

For heading 6, add ###### to the start of the line.

-

For block quotes, add>to start of the line.

+

For block quotes, add > to the start of the line.

-

For code span, add ` to front and back of the text.

+

For a code span, add ` to the front and back of the text.

-

For indented code block, add 4 spaces at the beginning of line.

+

For an indented code block, add 4 spaces at the beginning of the line.

-

For fenced code block, add ``` in the new line before and after the content.

+

For a fenced code block, add ``` on a new line before and after the content.

-

For ordered list, preceding the text with 1. (number with dot and one space)

+

For an ordered list, precede the text with a number followed by a dot and a space (for example, 1. ).

-

For unordered list, preceding the text with – (hyphen and space).

+

For an unordered list, precede the text with – (hyphen and space).

-

Link text without title text :
[Link text](URL)
Link text with title text :
[Link text](URL , “title text”)

+

Link text without title text:
[Link text](URL)
Link text with title text:
[Link text](URL , “title text”)

-

For hyperlink, enclose the link text within the brackets [ ], and then enclose the URL as first parameter and title as second parameter within the parentheses().
Note:The title text is optional.

+

For a hyperlink, enclose the link text within brackets [ ], and then enclose the URL as the first parameter and the title as the second parameter within parentheses ().
Note: The title text is optional.

Table Syntax in Markdown -

Create a table using the pipes and underscores as given in the syntax to create 2 x 2 table.

-

-

You can also set column alignments using the syntax below, default it is left aligned.

-

Right alignment:
Right aligned table Syntax in Markdown

Center alignment:
Center aligned table Syntax in Markdown

+

Create a table using the pipes and underscores as shown in the syntax to create a 2 x 2 table.

+

You can also set column alignments using the syntax below; the default is left aligned.

+

Right alignment:
Right aligned table syntax in Markdown

Center alignment:
Center aligned table syntax in Markdown

-

For horizontal line, add --- (three hyphens) in a new line.

+

For a horizontal line, add --- (three hyphens) on a new line.

-

For image, enclose an alternative text within the brackets [], and then link of the image source within parentheses ().

-

If URL path is base64string, then it will be preserved properly in Word document. Otherwise, you can also {{'[set image from stream while opening Markdown file.](https://help.syncfusion.com/document-processing/word/word-library/net/convert-markdown-to-word-document-in-csharp#customize-image-data)'| markdownify }}

+

For an image, enclose alternative text within brackets [], and then the image URL within parentheses ().

+

If the URL is a base64 string, it will be preserved properly in the Word document. Otherwise, see the [customize image data](#customize-image-data) section to set the image from a stream while opening the Markdown file.

@@ -300,7 +300,7 @@ document.EnsureMinimal() 'Appends text to the last paragraph of the document document.LastParagraph.AppendText("Hello World") 'Saves and closes the Word document -document.Save("BinaryDocument.doc ") +document.Save("BinaryDocument.doc") document.Close() {% endhighlight %} @@ -371,7 +371,7 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) {% highlight c# tabtitle="C# [Windows-specific]" %} //Loads an existing document WordDocument document = new WordDocument("Template.docx", FormatType.Docx); -//Saves the Word document(.docx) as binary document(.doc) file +//Saves the Word document (.docx) as Word 97-2003 document (.doc) document.Save("DocxToBinary.doc", FormatType.Doc); //Closes the document document.Close(); @@ -380,7 +380,7 @@ document.Close(); {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Loads an existing document Dim document As New WordDocument("Template.docx", FormatType.Docx) -'Saves the Word document(.docx) as binary document(.doc) file +'Saves the Word document (.docx) as Word 97-2003 document (.doc) document.Save("DocxToBinary.doc", FormatType.Doc) 'Closes the document document.Close() @@ -394,7 +394,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync DOT is the binary template file format used in Word 97–Word 2003 and is used to create new documents from an existing template. -The following code example illustrates how to create a binary format document template with a few lines of code. +The following code example illustrates how to create a Word 97-2003 template document with a few lines of code. {% tabs %} @@ -493,9 +493,9 @@ document.Close You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-file-formats/Save-Word-with-compatibility). -#### Save Word in old compatibility +#### Save Word with a specific compatibility mode -The following code example illustrates how to save a Word document in old compatibility using DocIO. +The following code example illustrates how to save a Word document with a chosen compatibility mode using DocIO. The available `CompatibilityMode` values include `Word2007`, `Word2010`, `Word2013`, `Word2016`, and `Word2019`; see the [CompatibilityMode API reference](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.CompatibilityMode.html) for the full list. {% tabs %} @@ -555,11 +555,11 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ### Open a Word (*.doc) document containing incremental save information -Essential® DocIO process the content that are preserved in the last complete save operation alone from a Word (.doc) document and it doesn't process the incremental save information. Hence it throws "Complex format is not supported" exception when attempting to open a Word (.doc) document containing incremental save information. +Essential® DocIO processes only the content that was preserved in the last complete save operation of a Word (.doc) document and does not process incremental save information. Therefore, it throws a "Complex format is not supported" exception when attempting to open a Word (.doc) document that contains incremental save information. -You can open the Word (*.doc) documents containing incremental save information without exception by setting [SkipIncrementalSaveValidation](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.Settings.html#Syncfusion_DocIO_DLS_Settings_SkipIncrementalSaveValidation) property of Settings class as true. Whereas the recent changes saved as incremental save information using older Microsoft Word application can't be preserved. +You can open Word (*.doc) documents containing incremental save information without an exception by setting the [SkipIncrementalSaveValidation](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.Settings.html#Syncfusion_DocIO_DLS_Settings_SkipIncrementalSaveValidation) property of the `Settings` class to `true`. -The following code example illustrates how to open a Word (*.doc) document containing incremental save information without exception. +The following code example illustrates how to open a Word (*.doc) document containing incremental save information without an exception. {% tabs %} diff --git a/Document-Processing/Word/Conversions/word-to-epub-conversion.md b/Document-Processing/Word/Conversions/word-to-epub-conversion.md index 05424ca7e1..8c2cb0f7fa 100644 --- a/Document-Processing/Word/Conversions/word-to-epub-conversion.md +++ b/Document-Processing/Word/Conversions/word-to-epub-conversion.md @@ -1,23 +1,25 @@ --- title: Convert Word document to EPUB in C# | DocIO | Syncfusion -description: Learn how to convert Word document to EPUB using the .NET Word (DocIO) library without Microsoft Word or interop dependencies +description: Learn how to convert Word document to EPUB using the .NET Word (DocIO) library without Microsoft Word or interop dependencies platform: document-processing control: DocIO documentation: UG --- -# Converting Word document to EPUB +# Convert Word document to EPUB -The Word document files are converted as EPUB v2.0 file format with few lines of code by using the Essential® DocIO. +Convert a Word document to the EPUB v2.0 file format with a few lines of code by using Essential® DocIO. ## Assemblies and NuGet packages required -Refer to the following links for assemblies and NuGet packages required based on platforms to convert a Word document to EPUB file using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). +Refer to the following links for the assemblies and NuGet packages required based on your platform to convert a Word document to an EPUB file using the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO). * [Word to EPUB conversion assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required) * [Word to EPUB conversion NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required) -The following code illustrates how to convert the Word document to EPUB file. +> Word to EPUB conversion is supported only in Windows Forms, UWP, WPF, ASP.NET Web, and ASP.NET MVC. + +The following code illustrates how to convert the Word document to an EPUB file. {% tabs %} @@ -67,7 +69,7 @@ Save(stream, "WordToEPub.epub"); //Closes the document document.Close(); -//Saves the Word document +//Saves the EPUB file using a file picker async void Save(MemoryStream streams, string filename) { streams.Position = 0; @@ -89,16 +91,16 @@ async void Save(MemoryStream streams, string filename) { using (IRandomAccessStream zipStream = await stFile.OpenAsync(FileAccessMode.ReadWrite)) { - //Write compressed data from memory to file + //Writes compressed data from memory to the file using (Stream outstream = zipStream.AsStreamForWrite()) { - byte[] buffer = streams.ToArray(); + byte[] buffer = outputStream.ToArray(); outstream.Write(buffer, 0, buffer.Length); outstream.Flush(); } } } - //Launch the saved Word file + //Launches the saved EPUB file in the default reader await Windows.System.Launcher.LaunchFileAsync(stFile); } {% endhighlight %} @@ -124,3 +126,8 @@ The following elements are supported in Word to EPUB conversion. ## Frequently Asked Questions * [How to set title when converting Word document to EPUB?](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/html-and-epub-conversions-faqs#how-to-set-title-when-converting-word-document-to-epub) + +## See also + +* [Word to HTML conversion](html-conversions) +* [Word to Markdown conversion](word-to-markdown-conversion) diff --git a/Document-Processing/Word/Conversions/word-to-markdown-conversion.md b/Document-Processing/Word/Conversions/word-to-markdown-conversion.md index ab7517cb6b..f1f1155ba7 100644 --- a/Document-Processing/Word/Conversions/word-to-markdown-conversion.md +++ b/Document-Processing/Word/Conversions/word-to-markdown-conversion.md @@ -24,7 +24,7 @@ Refer to the following links for assemblies and NuGet packages required based on Convert an existing Word document or document that is created from scratch into a Markdown file using the .NET Word (DocIO) library. -The following code example shows how to convert a Word document to a Markdown. +The following code example shows how to convert a Word document to a Markdown file. N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. @@ -301,19 +301,20 @@ N> Nested block quotes are not supported in a Word to the Markdown conversion. T ## Save Options -When converting a Word document to Markdown, the .NET Word (DocIO) library provides various save options to customize the output Markdown file. These options allow you to control image export location, customize image paths, set character encoding, and other export behaviors. +When converting a Word document to Markdown, the .NET Word (DocIO) library provides various save options to customize the output Markdown file. These options allow you to control the image export folder, customize image paths, and set the character encoding used to write the output. -When converting a Word document to a Markdown using the [Save(fileName)](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html#Syncfusion_DocIO_DLS_WordDocument_Save_System_String_) overloads, DocIO creates a new folder parallel to the output file name and exports all the images into it as default. +When converting a Word document to Markdown using the [Save(fileName)](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html#Syncfusion_DocIO_DLS_WordDocument_Save_System_String_) overloads, DocIO creates a new folder parallel to the output file name and exports all the images into it as default. -When converting a Word document to a Markdown using the [Save(Stream, FormatType)](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html#Syncfusion_DocIO_DLS_WordDocument_Save_System_IO_Stream_Syncfusion_DocIO_FormatType_) overloads, DocIO preserves the images as base64 format in the output Markdown file as default. +When converting a Word document to Markdown using the [Save(Stream, FormatType)](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.WordDocument.html#Syncfusion_DocIO_DLS_WordDocument_Save_System_IO_Stream_Syncfusion_DocIO_FormatType_) overloads, DocIO preserves the images as base64 format in the output Markdown file as default. Also, customize the above default behaviors using the following options in DocIO. + ### Export images to folder -Specify the folder location to export the images using the [MarkdownExportImagesFolder](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.SaveOptions.html#Syncfusion_DocIO_DLS_SaveOptions_MarkdownExportImagesFolder) API. +Specify the folder location to export the images using the [MarkdownExportImagesFolder](https://help.syncfusion.com/cr/document-processing/Syncfusion.DocIO.DLS.SaveOptions.html#Syncfusion_DocIO_DLS_SaveOptions_MarkdownExportImagesFolder) API. If the folder does not exist, DocIO creates it automatically. -The following code example illustrates how set the images folder to export the images while converting a Word document to a Markdown file. +The following code example illustrates how to set the images folder to export the images while converting a Word document to a Markdown file. {% tabs %} @@ -341,7 +342,7 @@ using (WordDocument document = new WordDocument("Input.docx", FormatType.Docx)) {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Open an existing Word document. -Using document As WordDocument = New WordDocument("Input.docx") +Using document As WordDocument = New WordDocument("Input.docx", FormatType.Docx) 'Set images folder to export images. document.SaveOptions.MarkdownExportImagesFolder = "D:\\WordToMdConversion "; 'Save a document as a Markdown file. @@ -355,7 +356,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ### Customize the image path -DocIO provides an `ImageNodeVisited` event, which is used to customize the image path to set in the output Markdown file and save images externally while converting a Word document to a Markdown. +DocIO provides an `ImageNodeVisited` event, which is used to customize the image path to set in the output Markdown file and save images externally while converting a Word document to Markdown. The following code example illustrates how to save Image files during a Word to Markdown Conversion. @@ -374,7 +375,7 @@ The following code example illustrates how to save Image files during a Word to {% highlight c# tabtitle="C# [Windows-specific]" %} //Open an existing Word document. -using (WordDocument document = new WordDocument(@"Input.docx")) +using (WordDocument document = new WordDocument("Input.docx")) { //Hook the event to customize the image. document.SaveOptions.MarkdownSaveOptions.ImageNodeVisited += SaveImage; @@ -439,7 +440,7 @@ End Sub You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Markdown-conversion/Customize-image-path). -N> The `MarkdownExportImagesFolder`property and `MarkdownSaveOptions.ImageNodeVisited` event are not supported on the UWP platform. +N> The `MarkdownExportImagesFolder` property and `MarkdownSaveOptions.ImageNodeVisited` event are not supported on the UWP platform. ### Encoding @@ -474,7 +475,7 @@ using (WordDocument document = new WordDocument("Input.docx")) {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Open an existing Word document. Using document As WordDocument = New WordDocument("Input.docx") - 'Set the encoding values. + 'Specify the character encoding for the output Markdown file. document.SaveOptions.MarkdownSaveOptions.Encoding = Encoding.ASCII 'Save the document as a Markdown file. document.Save("WordtoMd.md") diff --git a/Document-Processing/Word/Conversions/word-to-odt-conversion.md b/Document-Processing/Word/Conversions/word-to-odt-conversion.md index 138abc77ba..337216328d 100644 --- a/Document-Processing/Word/Conversions/word-to-odt-conversion.md +++ b/Document-Processing/Word/Conversions/word-to-odt-conversion.md @@ -8,7 +8,7 @@ documentation: UG # Converting Word to ODT format -The [OpenDocument format (ODF)](http://en.wikipedia.org/wiki/OpenDocument#) is an open file format for office documents originally developed for Open Office suite by Sun Microsystems. OpenDocument Text (ODT) is the file format for Word processing documents and currently for an OASIS and ISO standard. +The [OpenDocument format (ODF)](http://en.wikipedia.org/wiki/OpenDocument) is an open file format for office documents originally developed for the OpenOffice suite by Sun Microsystems. OpenDocument Text (ODT) is the file format for word-processing documents and is currently an OASIS and ISO standard. ## Assemblies and NuGet packages required @@ -19,7 +19,7 @@ Refer to the following links for assemblies and NuGet packages required based on The Essential® DocIO supports converting the Word document into ODT file. The following code example shows how to convert the Word document into ODT file. -N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. +N> Refer to the appropriate tabs in the code snippet section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. {% tabs %} @@ -37,20 +37,20 @@ using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx) {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} -//Loads the existing Word document +//Load the existing Word document WordDocument document = new WordDocument("Template.docx"); -//Saves the document as ODT file +//Save the document as an ODT file document.Save("WordToODT.odt", FormatType.Odt); -//Closes the document +//Close the document document.Close(); {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -'Loads the existing Word document +'Load the existing Word document Dim document As New WordDocument("Template.docx") -'Saves the document as ODT file +'Save the document as an ODT file document.Save("WordToODT.odt", FormatType.Odt) -'Closes the document +'Close the document document.Close() {% endhighlight %} From b8b606366c54ad00bbf611ecaf58da615b685f22 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 12:45:41 +0530 Subject: [PATCH 2/7] Added fixes in agent tool library UG --- Document-Processing/ai-agent-tools/customization.md | 6 +++--- .../ai-agent-tools/example-use-cases.md | 12 +++++------- .../ai-agent-tools/getting-started.md | 10 +++++----- Document-Processing/ai-agent-tools/overview.md | 6 +++--- Document-Processing/ai-agent-tools/tools.md | 2 +- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Document-Processing/ai-agent-tools/customization.md b/Document-Processing/ai-agent-tools/customization.md index 15021949b5..187ab38aa3 100644 --- a/Document-Processing/ai-agent-tools/customization.md +++ b/Document-Processing/ai-agent-tools/customization.md @@ -9,12 +9,12 @@ documentation: ug # Customize the AI Agent Tool Library -The [Syncfusion Document SDK AI Agent Tool](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools) library is designed to be extensible. This guide walks you through creating a custom agent tool class and registering the tools with an AI agent so they are callable alongside the built-in tools. +The [Syncfusion Document SDK AI Agent Tool](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools) library is designed to be extensible. This guide walks you through creating a custom agent tool class and registering it with an AI agent so it is callable alongside the built-in tools. ## Creating a Custom AI Agent Tool Class -Follow these steps to enable new document operations to the [AI agent tool library](https://github.com/syncfusion/document-sdk-ai-agent-tools/tree/master/Syncfusion.DocumentSDK.AI.AgentTools). +Follow these steps to enable new document operations in the [AI agent tool library](https://github.com/syncfusion/document-sdk-ai-agent-tools/tree/master/Syncfusion.DocumentSDK.AI.AgentTools). **Step 1: Clone the repository** @@ -133,7 +133,7 @@ var agent = openAIClient.AsAIAgent( systemPrompt: "You are a helpful document-processing assistant."); ``` -Your custom tool methods are now callable by the AI agent the same way as all built-in tools. +Your custom tool methods are now callable by the AI agent in the same way as the built-in tools. ## Example Prompts diff --git a/Document-Processing/ai-agent-tools/example-use-cases.md b/Document-Processing/ai-agent-tools/example-use-cases.md index b39fb75cc9..45876c1827 100644 --- a/Document-Processing/ai-agent-tools/example-use-cases.md +++ b/Document-Processing/ai-agent-tools/example-use-cases.md @@ -22,7 +22,7 @@ This example demonstrates an **Automated PDF Redaction Agent** that uses the [Mi | AI Provider API Key | Required to authenticate requests to the AI provider. This page uses OpenAI. | | NuGet Packages | [Syncfusion.DocumentSDK.AI.AgentTools](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools), [Microsoft.Agents.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Agents.AI.OpenAI) | -### How it works +### How It Works At runtime the application performs the following steps: @@ -32,7 +32,7 @@ At runtime the application performs the following steps: 4. **Locate and redact:** All identified items are located using bounding box coordinates and permanently redacted with black boxes. 5. **Export:** The redacted PDF is saved to the output folder with a `_redacted.pdf` suffix. The original file remains unchanged. -### Syncfusion setup +### Syncfusion Setup The snippet below shows only the Syncfusion-specific configuration. You can find the complete code snippet [here](https://github.com/syncfusion/document-sdk-ai-agent-tools/blob/master/Examples/Console/AutomatedPDFRedaction/Program.cs). @@ -96,20 +96,18 @@ This example demonstrates a **Blog Generator** that uses the [Microsoft Agent Fr | OpenAI Models | A text model (default **gpt-4o**) and an image model (default **gpt-image-1.5**) | | NuGet Packages | [Syncfusion.DocumentSDK.AI.AgentTools](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools), [Microsoft.Agents.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Agents.AI.OpenAI) | -### How it works - - +### How It Works At runtime the application performs the following steps: -1. **Ask blog topic.** The user enters a topic from the console. +1. **Ask blog topic.** The user enters a topic via the console. 2. **Generate title and outline.** The agent drafts a title and 6–10 section outline for user confirmation (`[Y/n/r]`). 3. **Draft blog content as HTML.** For each section the agent generates structured HTML with consistent styling. 4. **Generate images.** For sections that need visuals, the **gpt-image-1.5** model generates PNG images embedded as Base64. 5. **Convert HTML to Word.** The AI agent autonomously chains [CreateDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.AI.AgentTools.Word.WordDocumentAgentTools.html#Syncfusion_AI_AgentTools_Word_WordDocumentAgentTools_CreateDocument_System_String_System_String_) → [ImportHtml](https://help.syncfusion.com/cr/document-processing/Syncfusion.AI.AgentTools.Word.WordImportExportAgentTools.html#Syncfusion_AI_AgentTools_Word_WordImportExportAgentTools_ImportHtml_System_String_System_String_System_String_) → [ExportDocument](https://help.syncfusion.com/cr/document-processing/Syncfusion.AI.AgentTools.Word.WordDocumentAgentTools.html#Syncfusion_AI_AgentTools_Word_WordDocumentAgentTools_ExportDocument_System_String_System_String_System_String_) using [WordDocumentAgentTools](https://help.syncfusion.com/cr/document-processing/Syncfusion.AI.AgentTools.Word.WordDocumentAgentTools.html) and [WordImportExportAgentTools](https://help.syncfusion.com/cr/document-processing/Syncfusion.AI.AgentTools.Word.WordImportExportAgentTools.html). 6. **Save output.** Both the assembled HTML and the converted Word document are saved to the output folder. -### Syncfusion setup +### Syncfusion Setup The snippet below shows only the Syncfusion-specific configuration. You can find the complete code snippet [here](https://github.com/syncfusion/document-sdk-ai-agent-tools/blob/master/Examples/Console/BlogGenerator/Program.cs). diff --git a/Document-Processing/ai-agent-tools/getting-started.md b/Document-Processing/ai-agent-tools/getting-started.md index a69b853caa..85eaba8baa 100644 --- a/Document-Processing/ai-agent-tools/getting-started.md +++ b/Document-Processing/ai-agent-tools/getting-started.md @@ -64,7 +64,7 @@ The example below uses the Microsoft Agents Framework with OpenAI. The same step |---|---| | .NET SDK | .NET 8.0 or later| | AI Provider API Key | Required to authenticate requests to the AI provider. This page uses OpenAI.| -| NuGet Package | [Microsoft.Agents.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Agents.AI.OpenAI)| +| NuGet Packages | [Microsoft.Agents.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Agents.AI.OpenAI)| ### Integration @@ -74,7 +74,7 @@ Install the [Syncfusion.DocumentSDK.AI.AgentTools](https://www.nuget.org/package ![Install NuGet package](Install_Nuget.png) -After the packages installed, register your license key at application startup: +After the packages are installed, register your license key at application startup: ```csharp string? licenseKey = Environment.GetEnvironmentVariable("SYNCFUSION_LICENSE_KEY"); if (!string.IsNullOrEmpty(licenseKey)) @@ -274,7 +274,7 @@ public class AzureBlobStorage : IDocumentStorage public Stream Read(string filePath) { ArgumentException.ThrowIfNullOrEmpty(filePath); - var blob = _container.GetBlobClient(filePath); + var blob = _containerClient.GetBlobClient(filePath); var ms = new MemoryStream(); blob.DownloadTo(ms); ms.Position = 0; @@ -288,7 +288,7 @@ public class AzureBlobStorage : IDocumentStorage try { documentStream.Position = 0; - var blob = _container.GetBlobClient(filePath); + var blob = _containerClient.GetBlobClient(filePath); blob.Upload(documentStream, overwrite: true); return true; } @@ -301,7 +301,7 @@ public class AzureBlobStorage : IDocumentStorage public bool Exists(string filePath) { ArgumentException.ThrowIfNullOrEmpty(filePath); - return _container.GetBlobClient(filePath).Exists(); + return _containerClient.GetBlobClient(filePath).Exists(); } } ``` diff --git a/Document-Processing/ai-agent-tools/overview.md b/Document-Processing/ai-agent-tools/overview.md index 8b8d81eb63..15414840d7 100644 --- a/Document-Processing/ai-agent-tools/overview.md +++ b/Document-Processing/ai-agent-tools/overview.md @@ -11,9 +11,9 @@ documentation: ug [Syncfusion Document SDK AI Agent Tool](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools) is a .NET library that enables AI agents to autonomously create, manipulate, convert, and extract data from Word, Excel, PDF, PowerPoint, Markdown, and other document formats. It exposes pre-built, AI-callable tools built on [Syncfusion Document SDK](https://www.syncfusion.com/document-sdk) - no document-processing logic required in your host application. -You can quickly deploy it to your infrastructure via [NuGet](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools). If you want to add new functionality or customize any existing functionalities, then you can use our source code available on [GitHub](https://github.com/syncfusion/document-sdk-ai-agent-tools/tree/master/Syncfusion.DocumentSDK.AI.AgentTools). Compatible with .NET 8.0, 9.0, and 10.0. +You can quickly deploy it to your infrastructure via [NuGet](https://www.nuget.org/packages/Syncfusion.DocumentSDK.AI.AgentTools). If you want to add new functionality or customize existing functionality, you can use the source code available on [GitHub](https://github.com/syncfusion/document-sdk-ai-agent-tools/tree/master/Syncfusion.DocumentSDK.AI.AgentTools). Compatible with .NET 8.0, 9.0, and 10.0. -## How it works +## How It Works ![How AI Agent Tool Execution Works](how-it-works.png) @@ -117,7 +117,7 @@ You can quickly deploy it to your infrastructure via [NuGet](https://www.nuget.o
  • Structured data
  • Table
  • -
  • Form extraction from PDFs and images
  • +
  • Form extraction from pdf and image files
  • PDF and table to Markdown conversion
diff --git a/Document-Processing/ai-agent-tools/tools.md b/Document-Processing/ai-agent-tools/tools.md index 6cad8bd1f2..5b87097848 100644 --- a/Document-Processing/ai-agent-tools/tools.md +++ b/Document-Processing/ai-agent-tools/tools.md @@ -194,7 +194,7 @@ N> Tools that operate on a single document type (e.g., [WordDocumentAgentTools]( ### Document Storage Manager -Document Storage Manager reads documents from and writes them back to storage (such as Azure Blob Storage, S3, or local disk) on each tool invocation; no in‑memory objects are maintained, so every tool call opens and saves document instances, making this mode well suited for web APIs and applications that require horizontal scaling, support large documents, or need state persistence across sessions. +Document Storage Manager reads documents from and writes them back to storage (such as Azure Blob Storage, S3, or local disk) on each tool invocation; no in‑memory objects are maintained, so every tool call opens and saves document instances, making this mode well-suited for web APIs and applications that require horizontal scaling, support large documents, or need state persistence across sessions. ## See Also From ce1ee5e21c03de84eb78b1973d0618a9a57273e1 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 12:54:08 +0530 Subject: [PATCH 3/7] Modified forword toimage conversion UG --- .../NET/Assemblies-required-word-to-image.md | 15 +- ...onvert-Word-Document-to-Image-in-Blazor.md | 17 +-- .../NET/Fallback-fonts-word-to-image.md | 24 +-- .../NET/Font-substituion-word-to-image.md | 12 +- .../Nuget-packages-required-word-to-image.md | 140 +++++++++--------- .../Word-To-Image/NET/Performance-metrics.md | 21 ++- .../NET/Unsupported-elements-word-to-image.md | 22 +-- .../Word-To-Image/NET/word-to-image.md | 33 +++-- 8 files changed, 146 insertions(+), 138 deletions(-) diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Assemblies-required-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Assemblies-required-word-to-image.md index e5f70cf3fc..0fa0b41e7b 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Assemblies-required-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Assemblies-required-word-to-image.md @@ -1,13 +1,13 @@ --- title: Assemblies required to convert Word document to Image | Syncfusion -description: Learn the assemblies required to convert Word document to image using the .NET Word (DocIO) library. +description: Learn the assemblies required to convert a Word document to Image using the .NET Word (DocIO) library. platform: document-processing control: DocIO documentation: UG --- # Assemblies required to convert Word document to Image -## Converting Word document to image +## Converting Word document to Image For converting a Word document to image, the following assemblies need to be referenced in your application.
@@ -32,18 +32,18 @@ Syncfusion.DocIO.Portable
Syncfusion.Compression.Portable
Syncfusion.Off +Syncfusion.DocIO.NET
Syncfusion.Compression.NET
Syncfusion.OfficeChart.NET
Syncfusion.Pdf.NET
Syncfusion.DocIORenderer.NET
Syncfusion.Pdf.Imaging.NET
Syncfusion.MetafileRenderer.NET
SkiaSharp
Syncfusion.SkiaSharpHelper.NET
{{'[Windows UI Library (WinUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-winui)' | markdownify}}
{{'[.NET Multi-platform App UI (.NET MAUI)](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-maui)' | markdownify}}
-Syncfusion.DocIO.NET
Syncfusion.Compression.NET
Syncfusion.OfficeChart.NET
Syncfusion.Pdf.NET
Syncfusion.DocIORenderer.NET
Syncfusion.Pdf.Imaging.NET
Syncfusion.MetafileRenderer.NET
SkiaSharp
Syncfusion.SkiaSharpHelper.NET
T> 1. If you encounter issues while using the .NET Word library in ASP.NET Core, refer to the [troubleshooting guide](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues#things-to-check-while-facing-an-issue-in-word-library) for recommended checks and solutions. T> 2. Switch to NuGet packages for a seamless experience: T> * Get frequent bug fixes every week. T> * Upgrade quickly with no manual effort. -T> Note: To avoid trail watermark when using NuGet packages, it is recommended to register license key in application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +T> 3. To avoid a trial watermark when using NuGet packages, it is recommended to register the license key in the application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. T> T> Refer [here](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/nuget-packages-required-word-to-image) to know more about NuGet packages required. -#### Retired Platforms +### Retired Platforms The following assemblies need to be referenced in your application based on the platform. @@ -63,12 +63,13 @@ Syncfusion.DocIO.Base
Syncfusion.Compression.Base
Syncfusion.OfficeChart Syncfusion.DocIO.Portable
Syncfusion.Compression.Portable
Syncfusion.OfficeChart.Portable
Syncfusion.Pdf.Portable
Syncfusion.DocIORenderer.Portable
Syncfusion.Pdf.Imaging.Portable
Syncfusion.MetafileRenderer.Portable
SkiaSharp.HarfBuzz
Syncfusion.SkiaSharpHelper.Portable
+N> Xamarin is retired. For new development, migrate to [.NET MAUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-maui). N> 1. Starting with the v24.1.x, if you reference "Syncfusion.DocIORenderer", you have to add the "Syncfusion.Pdf.Imaging" assembly reference in your projects to perform Word to Image conversion. N> 2. Starting with the v27.1.x, if you reference "Syncfusion.DocIORenderer", you have to add the "Syncfusion.MetafileRenderer" assembly reference in your projects to perform Word to Image conversion. ## Converting Charts -The following assemblies are required to be referred in addition to the above mentioned assemblies for converting the chart present in the Word document and image. +The following assemblies are required to be referenced in addition to the above mentioned assemblies for converting the chart present in the Word document to image. @@ -81,7 +82,7 @@ WPF, Windows Forms, ASP.NET MVC
Syncfusion.OfficeChartToImageConverter.WPF
Syncfusion.SfChart.WPF
-#### Retired Platforms +### Retired Platforms The following assemblies need to be referenced in your application based on the platform. diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Convert-Word-Document-to-Image-in-Blazor.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Convert-Word-Document-to-Image-in-Blazor.md index ddf45598d4..4451f19541 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Convert-Word-Document-to-Image-in-Blazor.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Convert-Word-Document-to-Image-in-Blazor.md @@ -737,12 +737,6 @@ Step 2: Install the following **Nuget packages** in application from [Nuget.org] N> 1. If deploying the application in a Linux environment, refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/nuget-packages-required-word-to-image#additional-nuget-packages-required-for-linux) for the required additional NuGet packages. N> 2. Starting with v16.2.0.x, if Syncfusion® assemblies are referenced from trial setup or from the NuGet feed, the "Syncfusion.Licensing" assembly reference must also be added and a license key included in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in an application to use Syncfusion components. -N> 3. If you face issues related to SkiaSharp during runtime, install the necessary WebAssembly tools by running the following commands in the terminal: -N> ``` -N> dotnet workload install wasm-tools -N> ``` -N> After completing the installation, restart Visual Studio to ensure proper integration of the tools. - Step 3: Create a Razor file named `DocIO.razor` in the `Pages` folder. Add the following namespaces in the file: @@ -926,11 +920,7 @@ Step 2: To **convert a Word document to Image in Blazor WASM Standalone app**, i N> 1. If deploying the application in a Linux environment, refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/nuget-packages-required-word-to-image#additional-nuget-packages-required-for-linux) for the required additional NuGet packages. N> 2. Starting with v16.2.0.x, if Syncfusion® assemblies are referenced from trial setup or from the NuGet feed, the "Syncfusion.Licensing" assembly reference must also be added and a license key included in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in an application to use Syncfusion components. -N> 3. If you face issues related to SkiaSharp during runtime, install the necessary WebAssembly tools by running the following commands in the terminal: -N> ``` -N> dotnet workload install wasm-tools -N> ``` -N> After completing the installation, restart Visual Studio Code to ensure proper integration of the tools. + Step 3: Create a Razor file named `DocIO.razor` in the `Pages` folder. @@ -1134,11 +1124,6 @@ Step 2: Install the NuGet package from [NuGet.org](https://www.nuget.org/). N> 1. If deploying the application in a Linux environment, refer to the [documentation](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/nuget-packages-required-word-to-image#additional-nuget-packages-required-for-linux) for the required additional NuGet packages. N> 2. Starting with v16.2.0.x, if Syncfusion® assemblies are referenced from trial setup or from the NuGet feed, the "Syncfusion.Licensing" assembly reference must also be added and a license key included in projects. Refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in an application to use Syncfusion components. -N> 3. If you face issues related to SkiaSharp during runtime, install the necessary WebAssembly tools by running the following commands in the terminal: -N> ``` -N> dotnet workload install wasm-tools -N> ``` -N> After completing the installation, restart JetBrains Rider to ensure proper integration of the tools. Step 3: Create a Razor file named `DocIO.razor` in the `Pages` folder. diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md index b65e4e8404..a049ce1801 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Fallback-fonts-word-to-image.md @@ -8,18 +8,20 @@ documentation: UG # Fallback fonts in Word to Image conversion -During Word to image conversions, if a glyph of the input text is unavailable in the specified font, the text will not be rendered properly. To address this, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) allows users to specify fallback fonts. When a glyph is missing, the library will use one of the fallback fonts to render the text correctly in the output image. +During Word to image conversions, if a glyph of the input text is unavailable in the specified font, the text may not be rendered properly. To address this, the [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) allows users to specify fallback fonts. When a glyph is missing, the library will use one of the fallback fonts to render the text correctly in the output image. Users can configure fallback fonts in the following ways: * Initialize default fallback fonts. -* Set custom fonts as fallback fonts for specific script types, including Arabic, Hebrew, Chinese, Japanese, and more. +* Set custom fonts as fallback fonts for specific script types, such as Arabic, Hebrew, Chinese, Japanese, Symbols, Mathematics, and Emoji. * Set custom fonts as fallback fonts for a particular range of Unicode text. +* Modify the existing default fallback fonts. -N> DocIO internally uses user-initialized or specified fallback fonts for Unicode characters during Word to Image conversion. Therefore, the specified fallback fonts must be installed in the production environment or embedded in the input Word document (DOCX). Otherwise, it will not render the text properly using the fallback fonts. +N> 1. The fallback font APIs are supported on .NET Core, .NET Standard, and .NET 6+ (cross-platform) targets. They are **not supported in .NET Framework**, because DocIO uses System.Drawing for Word to image conversion in .NET Framework and System.Drawing already provides its own font fallback. +N> 2. DocIO internally uses user-initialized or specified fallback fonts for Unicode characters during Word to Image conversion. Therefore, the specified fallback fonts must be installed in the production environment or embedded in the input Word document (DOCX). Otherwise, the text will not be rendered properly using the fallback fonts. ## Initialize default fallback fonts -The following code example demonstrates how to initialize a default fallback fonts while converting a Word document to an Image. The *InitializeDefault* API sets the default fallback fonts for specific script types like Arabic, Hebrew, Chinese, Japanese etc. +The following code example demonstrates how to initialize the default fallback font collection while converting a Word document to an Image. The *InitializeDefault* API sets the default fallback fonts for specific script types like Arabic, Hebrew, Chinese, Japanese, etc. Calling `InitializeDefault()` resets the fallback font collection, so any custom fallback fonts added before this call will be removed. {% tabs %} @@ -111,9 +113,9 @@ using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, F You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Image-conversion/Fallback-fonts-based-on-scripttype). -## Fallback fonts for symbols +## Fallback fonts for Symbols, Mathematics, and Emoji -The following code example demonstrates how a user can add fallback fonts for Symbols and Emojis, which DocIO considers internally when converting a Word document to image. +The following code example demonstrates how a user can add fallback fonts for Symbols, Mathematics, and Emoji script types, which DocIO considers internally when converting a Word document to an image. {% tabs %} @@ -154,11 +156,11 @@ using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, F {% endtabs %} -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Image-conversion/Fallback-symbol-based-on-scripttype/) +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Image-conversion/Fallback-symbol-based-on-scripttype/). ## Fallback fonts for range of Unicode text -Users can set fallback fonts for specific Unicode range of text to be used in Word to Image conversion. +Users can set fallback fonts for a specific Unicode range of text to be used in Word to Image conversion. The `FallbackFont` constructor accepts the start range (`startRange`), the end range (`endRange`), and a comma-separated list of font names (`fontNames`). The following code example demonstrates how users can add fallback fonts by using a specific Unicode range of text that DocIO considers internally while converting a Word document to an image. @@ -211,9 +213,9 @@ using (FileStream inputStream = new FileStream("Template.docx", FileMode.Open, F You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-Image-conversion/Fallback-fonts-for-Unicode-range). -## Modify the exiting fallback fonts +## Modify the existing fallback fonts -The following code example demonstrates how user can modify or customize the existing fallback fonts using *FontNames* API while converting a Word document to an Image. +The following code example demonstrates how a user can modify or customize the existing fallback fonts using the *FontNames* API while converting a Word document to an Image. {% tabs %} @@ -582,7 +584,7 @@ Malgun Gothic, Batang N> 1. In Azure Web Service and Azure APP Service, .NET GDI+ (System.Drawing) does not support the Metafile image (vector image). So, the image will be generated as Bitmap (raster image). -N> 2. Creating an instance of the [ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word document to Image. Otherwise, the charts are not preserved in the generated image. +N> 2. Creating an instance of the[ChartToImageConverter](https://help.syncfusion.com/cr/document-processing/Syncfusion.OfficeChartToImageConverter.ChartToImageConverter.html) class is mandatory to convert the charts present in the Word document to Image. Otherwise, the charts are not preserved in the generated image. N> 3. Total number of images may vary based on unsupported elements in the input Word document. N> 4. Word to Image conversion has the same limitations and unsupported elements of Word to PDF conversion. N> 5. Different styles of borders are known limitations in Word to Image conversion in ASP.NET Core, Xamarin, Blazor, WinUI, and .NET MAUI platforms. diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Font-substituion-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Font-substituion-word-to-image.md index de2a23c160..1220789e4f 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Font-substituion-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Font-substituion-word-to-image.md @@ -8,9 +8,9 @@ documentation: UG # Font Substitution in Word to Image Conversion -When the necessary fonts used in the Word document has not been installed in the production machine, then Essential® DocIO uses the ”Microsoft Sans Serif” as default font for rendering the text. This leads to preservation difference in generated image as each font has different glyphs for characters. To learn more about the default font substitution, click [here](https://support.syncfusion.com/kb/article/6821/what-happens-when-the-word-document-used-fonts-for-a-text-is-not-installed-in-production). +When the necessary fonts used in the Word document have not been installed in the production machine, then Essential® DocIO uses the "Microsoft Sans Serif" as the default font for rendering the text. This leads to preservation differences in the generated image, as each font has different glyphs for characters. To learn more about the default font substitution, click [here](https://support.syncfusion.com/kb/article/6821/what-happens-when-the-word-document-used-fonts-for-a-text-is-not-installed-in-production). -To avoid this, the Essential® DocIO library allows you to set an alternate font for the missing font used in the Word document. +To avoid this, the Essential® DocIO library allows you to specify an alternate font for any missing font used in the Word document. ## Use alternate font from installed fonts @@ -158,7 +158,7 @@ The following code example shows how to use the alternate fonts instead of "Micr private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args) { //Sets the alternate font when a specified font is not installed in the production environment - if (args.OrignalFontName == "Arial Unicode MS") + if (args.OriginalFontName == "Arial Unicode MS") { //Sets the alternate font based on the font style. switch (args.FontStyle) @@ -181,7 +181,7 @@ private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args) { //Sets the alternate font when a specified font is not installed in the production environment - if (args.OrignalFontName == "Arial Unicode MS") + if (args.OriginalFontName == "Arial Unicode MS") { //Sets the alternate font based on the font style. switch (args.FontStyle) @@ -201,9 +201,9 @@ private void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -Private Sub SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs) +Private Sub FontSettings_SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs) 'Sets the alternate font when a specified font is not installed in the production environment - If args.OrignalFontName = "Arial Unicode MS" Then + If args.OriginalFontName = "Arial Unicode MS" Then 'Sets the alternate font based on the font style. Select Case args.FontStyle Case FontStyle.Italic diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Nuget-packages-required-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Nuget-packages-required-word-to-image.md index 70b69ca2fb..b635173030 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Nuget-packages-required-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Nuget-packages-required-word-to-image.md @@ -8,9 +8,9 @@ documentation: UG # NuGet Packages Required to Convert Word to Image -## Converting Word document to image +## Converting Word document to Image -For converting Word document into image, the following NuGet packages need to be installed in your application. +To convert a Word document to an image, the following NuGet packages need to be installed in your application. Ensure you have registered your Syncfusion® license key in your project before using these packages. @@ -50,28 +50,6 @@ Install-Package Syncfusion.DocIO.Wpf - - - - - - - - - - + + + + + + + + + +
-.NET Framework 3.5 or 4.0 Client Profile - -Syncfusion.DocIO.ClientProfile.nupkg - -Install-Package Syncfusion.DocIO.ClientProfile -
-ASP.NET MVC4 - -Syncfusion.DocIO.AspNet.Mvc4.nupkg - -Install-Package Syncfusion.DocIO.AspNet.Mvc4 -
ASP.NET MVC5 @@ -97,7 +75,7 @@ Install-Package Syncfusion.DocIORenderer.Net.Core
-Windows UI Library (WinUI)
.NET Multi-platform App UI (.NET MAUI) +Windows UI Library (WinUI)
.NET Multi-platform App UI (.NET MAUI)
Syncfusion.DocIORenderer.NET @@ -110,7 +88,7 @@ Install-Package Syncfusion.DocIORenderer.NET T> If you encounter issues while using the .NET Word library in ASP.NET Core, refer to the [troubleshooting guide](https://support.syncfusion.com/kb/article/16012/troubleshoot-guide-for-aspnet-core-word-docio-library-issues#things-to-check-while-facing-an-issue-in-word-library) for recommended checks and solutions. -#### Retired Platforms +### Retired Platforms The following NuGet packages need to be included in your application based on the platform. @@ -150,11 +128,33 @@ Syncfusion.Xamarin.DocIORenderer.nupkg Install-Package Syncfusion.Xamarin.DocIORenderer
+.NET Framework 3.5 or 4.0 Client Profile + +Syncfusion.DocIO.ClientProfile.nupkg + +Install-Package Syncfusion.DocIO.ClientProfile +
+{{'[ASP.NET MVC4](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-asp-net-mvc)' | markdownify}}
+
+Syncfusion.DocIO.AspNet.Mvc4.nupkg + +Install-Package Syncfusion.DocIO.AspNet.Mvc4 +
### Additional NuGet packages required for Linux -The SkiaSharp and HarfBuzzSharp native asset NuGet packages are required as additional dependencies when deploying your application in Linux environments. There are two types of NuGet packages—choose the appropriate ones based on your specific Linux environment. +The SkiaSharp and HarfBuzzSharp native asset NuGet packages are required as additional dependencies when deploying your application in Linux environments. Choose the appropriate package based on your specific Linux environment. The following table illustrates the native assets NuGet packages and their applicable Linux environments: @@ -195,7 +195,7 @@ The following table illustrates the native assets NuGet packages and their appli ## Converting Charts -The following NuGet package need to be installed additionally to preserve chart as image in Word to Image conversion. +In addition to the base Word-to-Image package, the following NuGet package needs to be installed to preserve charts as images during Word to Image conversion. @@ -257,9 +257,10 @@ Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5
-#### Retired Platforms -The following NuGet packages need to be included in your application based on the platform. +### Retired Platforms + +The following NuGet package needs to be referenced in your application based on the platform. @@ -286,74 +287,79 @@ Syncfusion.OfficeChartToImageConverter.AspNet.nupkg Install-Package Syncfusion.OfficeChartToImageConverter.AspNet + + + + +
+ASP.NET MVC4 + +Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4.nupkg + +Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 +
-N> 1. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you also have to add "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. -N> 2. Syncfusion® components are available in [nuget.org](https://www.nuget.org/) -N> 3. Syncfusion has **deprecated the ASP.NET package**. We strongly recommend upgrading your applications to ASP.NET Core. Refer [here](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/migrate-from-net-framework-to-net-core) to migrate from .NET Framework to .NET Core. +N> 1. Starting with v16.2.0.x, if you reference Syncfusion® assemblies from trial setup or from the NuGet feed, you must also add the "Syncfusion.Licensing" assembly reference and include a license key in your projects. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion® license key in your application to use our components. +N> 2. Syncfusion® components are available in [nuget.org](https://www.nuget.org/). +N> 3. Syncfusion has **deprecated the ASP.NET, Xamarin, and UWP packages**. We strongly recommend upgrading your applications to ASP.NET Core, .NET MAUI, or WinUI. Refer [here](https://help.syncfusion.com/document-processing/word/word-library/net/faqs/migrate-from-net-framework-to-net-core) to migrate from .NET Framework to .NET Core. ## NuGet Package Installation and Uninstallation -To use Syncfusion® NuGet packages in your project, please refer the NuGet Package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections. +To use Syncfusion® NuGet packages in your project, please refer to the NuGet Package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections. -DocIO NuGet packages can be installed and uninstalled using Package Manager Console. In Visual Studio, select Tools > NuGet Package Manager > Package Manager Console and execute the following commands. +DocIO NuGet packages can be installed and uninstalled using Package Manager Console. In Visual Studio, select Tools > NuGet Package Manager > Package Manager Console and execute the following commands. The following examples use the `OfficeChartToImageConverter` packages; replace the package name with the appropriate DocIO/DocIORenderer package for your platform. ### Windows Forms **NuGet Package:** Syncfusion.OfficeChartToImageConverter.WinForms -The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. +The package contains the OfficeChartToImageConverter .NET library for converting the chart present in a Word document to an image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.WinForms -~~~ -~~~ +``` + +```powershell // Uninstall package -Uninstall-Package Syncfusion.OfficeChartToImageConverter.WinForms -RemoveDependencies -~~~ +Uninstall-Package Syncfusion.OfficeChartToImageConverter.WinForms -RemoveDependencies +``` ### WPF **NuGet Package:** Syncfusion.OfficeChartToImageConverter.Wpf -The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. +The package contains the OfficeChartToImageConverter .NET library for converting the chart present in a Word document to an image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.Wpf -~~~ -~~~ -// Uninstall package -Uninstall-Package Syncfusion.OfficeChartToImageConverter.Wpf -RemoveDependencies -~~~ +``` -### ASP.NET MVC4 - -**NuGet Package:** Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 - -The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. - -~~~ -// Install package -Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -~~~ -~~~ +```powershell // Uninstall package -Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc4 -RemoveDependencies -~~~ +Uninstall-Package Syncfusion.OfficeChartToImageConverter.Wpf -RemoveDependencies +``` ### ASP.NET MVC5 **NuGet Package:** Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -The package contains OfficeChartToImageConverter .NET library for converting the chart present in word document to image. +The package contains the OfficeChartToImageConverter .NET library for converting the chart present in a Word document to an image. -~~~ +```powershell // Install package Install-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -~~~ -~~~ +``` + +```powershell // Uninstall package -Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -RemoveDependencies -~~~ \ No newline at end of file +Uninstall-Package Syncfusion.OfficeChartToImageConverter.AspNet.Mvc5 -RemoveDependencies +``` + +## See Also + +* [Word to Image conversion overview](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image) +* [Assemblies required to convert Word to Image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/assemblies-required-word-to-image) +* [Syncfusion® Licensing overview](https://help.syncfusion.com/common/essential-studio/licensing/overview) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Performance-metrics.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Performance-metrics.md index 25f112f978..dbcdca501e 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Performance-metrics.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Performance-metrics.md @@ -1,18 +1,18 @@ --- -title: Word to image Performance benchmark results | Syncfusion -description: Explore the performance benchmark results of Word to image conversion using the .NET Word Library with different page counts +title: Word to Image Performance Benchmark Results | Syncfusion +description: Explore the performance benchmark results of Word-to-Image conversion using the Syncfusion .NET Word Library across different operations and document sizes. platform: document-processing control: DocIO documentation: UG --- -# Word to image performance metrics in .NET Word Library +# Word-to-Image Performance Benchmarks in .NET Word Library -The Syncfusion® .NET Word library (DocIO) enables high-performance Word document processing, including conversion to images. This performance benchmark report highlights the speed and efficiency of Word to image conversion, demonstrating how our library performs across varying document sizes in real-world scenarios. +The Syncfusion® .NET Word library (DocIO) enables high-performance Word document processing, including Word-to-Image conversion. This performance benchmark report highlights the speed and efficiency of the conversion, demonstrating how the library performs across varying document sizes and feature scenarios in real-world conditions. ## Environment -The following system configurations were used for benchmarking: +The following system configurations and test methodology were used for benchmarking: * **Operating System:** Windows 11 * **Processor:** AMD Ryzen 5 7520U with Radeon Graphics @@ -22,7 +22,7 @@ The following system configurations were used for benchmarking: ## Benchmark Results -The table below shows the performance results of various Word document operations, evaluated using predefined input conditions in the previously described environment. +The table below shows the performance results of various Word-to-Image operations, evaluated using the predefined input conditions described in the previous sections. Times are measured in seconds and include document loading, conversion, and image saving. @@ -57,4 +57,11 @@ The table below shows the performance results of various Word document operation
-N> Execution times are based on the sample documents and may vary with different content or environments. \ No newline at end of file +N> Execution times are based on the sample documents and may vary with different content or environments. + +## Related Links + +* [Word-to-Image Overview](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image) +* [Word-to-Image FAQs](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image-conversion-faqs) +* [Assemblies Required for Word-to-Image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/assemblies-required-word-to-image) +* [NuGet Packages Required for Word-to-Image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/nuget-packages-required-word-to-image) \ No newline at end of file diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/Unsupported-elements-word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/Unsupported-elements-word-to-image.md index 8b004e4624..fd428f7f09 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/Unsupported-elements-word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/Unsupported-elements-word-to-image.md @@ -1,14 +1,14 @@ --- -title: Limitations in Word to Image Conversion | DocIO | Syncfusion -description: Learn about the limitations in Word to Image conversion in C# using the .NET Word (DocIO) library for effective application. +title: Limitations in Word-to-Image Conversion | DocIO | Syncfusion +description: Learn about the limitations in Word-to-Image conversion in C# using the .NET Word (DocIO) library for effective application. platform: document-processing control: DocIO documentation: UG --- -# Limitations in Word to Image Conversion +# Limitations in Word-to-Image Conversion -The following tables shows the limitations of Word to Image conversion. +The following tables show the limitations of Word-to-Image conversion. @@ -43,7 +43,7 @@ Only DOCX and WordML format documents are supported. @@ -78,7 +78,7 @@ Not supported Watermark @@ -86,7 +86,7 @@ First watermark of the Word document should be applied to the entire converted P Multi-Column Texts @@ -94,7 +94,7 @@ Multi-Column text positions are calculated dynamically when layout the text. So, Footnote and endnote @@ -135,7 +135,7 @@ Only DOCX and WordML format documents are supported. Pagination @@ -159,7 +159,7 @@ Not supported Borders diff --git a/Document-Processing/Word/Conversions/Word-To-Image/NET/word-to-image.md b/Document-Processing/Word/Conversions/Word-To-Image/NET/word-to-image.md index 73ffa7a804..4100a444fc 100644 --- a/Document-Processing/Word/Conversions/Word-To-Image/NET/word-to-image.md +++ b/Document-Processing/Word/Conversions/Word-To-Image/NET/word-to-image.md @@ -1,6 +1,6 @@ --- -title: Convert Word to Image in .NET Word Library| DocIO | Syncfusion -description: Learn how to convert a Word document to image using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. +title: Convert Word to Image in .NET Word Library | DocIO | Syncfusion +description: Learn how to convert a Word document to an image using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. platform: document-processing control: DocIO documentation: UG @@ -8,17 +8,17 @@ documentation: UG # Convert Word to Image in Syncfusion® .NET Word Library -The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert Word document to image within a few lines of code in .NET applications and also it does not require Adobe and Microsoft Word application to be installed in the machine. Using this, you can create an input Word document from scratch or load an existing Word document and then easily convert to Image. +The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) allows you to convert a Word document to an image within a few lines of code in .NET applications, and it does not require Microsoft Word or Adobe Acrobat to be installed on the machine. Using this, you can create an input Word document from scratch or load an existing Word document and then easily convert it to an image. The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) to image converter offers high versatility and seamless performance across various .NET platforms, including [Windows Forms](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-windows-forms), [WPF](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-wpf), [ASP.NET](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-asp-net), [ASP.NET MVC](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-asp-net-mvc), [ASP.NET Core](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-asp-net-core), [Blazor](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-blazor), [Xamarin](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-xamarin), [WinUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-winui), [.NET MAUI](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-maui). Also, in different environments like [Azure](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-azure), [AWS](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-aws), [Google Cloud](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-google-cloud-platform), [Linux](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-linux), and [macOS](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/convert-word-document-to-image-in-mac). ## Key Features -* Ability to [convert entire word document to images](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-the-entire-word-to-images). -* Ability to [convert specific page of Word to image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-specific-page-of-word-to-image). -* Ability to [convert specific range of pages in Word to images](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-a-specific-range-of-pages-in-word-to-images). -* Ability to [convert a Word document to an image using custom image resolution](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#custom-image-resolution). -* Set [fallback fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/fallback-fonts-word-to-image) for characters when glyphs are not available. +* Ability to [convert the entire Word document to images](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-the-entire-word-document-to-images). +* Ability to [convert a specific page of a Word document to an image](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-specific-page-of-word-to-image). +* Ability to [convert a specific range of pages in a Word document to images](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#convert-a-specific-range-of-pages-in-word-to-images). +* Ability to [convert a Word document to an image using a custom image resolution](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/word-to-image#custom-image-resolution). +* Set [fallback fonts](https://help.syncfusion.com/document-processing/word/conversions/word-to-image/net/fallback-fonts-word-to-image) for characters when glyphs are not available. ## Assemblies and NuGet packages required @@ -39,12 +39,16 @@ N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-plat {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} +using System.IO; using Syncfusion.DocIO; using Syncfusion.DocIO.DLS; using Syncfusion.DocIORenderer; {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} +using System.IO; +using System.Drawing; +using System.Drawing.Imaging; using Syncfusion.DocIO; using Syncfusion.DocIO.DLS; using Syncfusion.OfficeChart; @@ -52,6 +56,9 @@ using Syncfusion.OfficeChartToImageConverter; {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Imports System.IO +Imports System.Drawing +Imports System.Drawing.Imaging Imports Syncfusion.DocIO Imports Syncfusion.DocIO.DLS Imports Syncfusion.OfficeChart @@ -83,7 +90,7 @@ using (FileStream docStream = new FileStream("Template.docx", FileMode.Open, Fil Stream[] imageStreams = wordDocument.RenderAsImages(); for (int i = 0; i < imageStreams.Length; i++) { -  //Save the image stream as file. + //Save the image stream as file. using (FileStream fileStreamOutput = File.Create("WordToImage_" + i + ".jpeg")) { imageStreams[i].CopyTo(fileStreamOutput); @@ -257,7 +264,7 @@ Using wordDocument As WordDocument = New WordDocument("Template.docx", FormatTyp wordDocument.ChartToImageConverter = New ChartToImageConverter() 'Set the scaling mode for charts (Normal mode reduces the file size). wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal - 'Convert the entire Word document to images. + 'Convert a specific range of pages in the Word document to images. Dim images As Image() = wordDocument.RenderAsImages(1, 2, ImageType.Bitmap) Dim i = 0 For Each image As Image In images @@ -276,7 +283,7 @@ T> For troubleshooting issues in the [.NET Word Library](https://www.syncfusion. ## Supported File formats -The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) supports below formats to convert into image. +The [.NET Word Library](https://www.syncfusion.com/document-sdk/net-word-library) (DocIO) supports the following formats for conversion to image. * DOC, DOCX, Word Processing XML (2003 & 2007), DOT, DOTX, DOCM, and DOTM * RTF @@ -293,7 +300,7 @@ The following code snippet illustrates how to convert a Word document to an imag {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} -//DocIO only supports Word to image conversion in Windows Forms, WPF, ASP.NET and ASP.NET MVC platform. +//Custom image resolution for Word to image conversion is only supported on Windows Forms, WPF, ASP.NET, and ASP.NET MVC platforms. {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} @@ -372,7 +379,7 @@ During Word to Image conversions, if a glyph of the input text is unavailable in ## See Also * [Supported file formats](https://help.syncfusion.com/document-processing/word/word-library/net/support-file-formats) -* [How to convert word to tiff using C#, VB.NET](https://support.syncfusion.com/kb/article/9541/how-to-convert-word-to-tiff-using-c-vb-net) +* [How to convert Word to TIFF using C#, VB.NET](https://support.syncfusion.com/kb/article/9541/how-to-convert-word-to-tiff-using-c-vb-net) * [How to convert Word to Image in Blazor WebAssembly (WASM)?](https://support.syncfusion.com/kb/article/12123/how-to-convert-word-to-image-in-blazor-webassembly-wasm) * [How to resolve font problems during Word to Image conversion?](https://support.syncfusion.com/kb/article/13969/how-to-resolve-font-problems-during-word-to-pdf-or-image-conversion) * [How to convert Word document to images and combine it as single image using SkiaSharp library?](https://support.syncfusion.com/kb/article/17072/how-to-convert-entire-word-document-to-images-and-combine-it-as-single-image-using-c) From 787855b80e9d612cb8a770077d3012f31d173c94 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 13:09:16 +0530 Subject: [PATCH 4/7] Modified for Markdown changes mergeed in development UG --- .../Markdown/Conversions/html-conversions.md | 18 ++++++------- .../Markdown/Conversions/markdown-to-pdf.md | 6 ++--- .../NET/Assemblies-Required.md | 2 +- .../NET/Loading-and-Saving-document.md | 4 +-- .../NET/NuGet-Packages-Required.md | 6 ++--- .../Markdown/Markdown-Library/NET/Overview.md | 4 +-- .../NET/Working-with-Image.md | 26 +++++++++++-------- .../NET/Working-with-Paragraph.md | 4 +-- .../NET/Working-with-code-blocks.md | 11 ++++---- .../NET/Working-with-lists.md | 12 ++++----- .../NET/Working-with-tables.md | 6 +++-- .../Markdown/Markdown-Library/overview.md | 2 +- Document-Processing/Markdown/overview.md | 8 +++--- 13 files changed, 57 insertions(+), 52 deletions(-) diff --git a/Document-Processing/Markdown/Conversions/html-conversions.md b/Document-Processing/Markdown/Conversions/html-conversions.md index 5a194d328a..2293783cc7 100644 --- a/Document-Processing/Markdown/Conversions/html-conversions.md +++ b/Document-Processing/Markdown/Conversions/html-conversions.md @@ -8,11 +8,11 @@ documentation: UG # Markdown to HTML and HTML to Markdown Conversions -Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to HTML document and vice versa. +Markdown is a lightweight markup language that adds formatting elements to plain text documents. The Syncfusion® .NET Word (DocIO) library supports converting Markdown to an HTML document and vice versa. ## Assemblies and NuGet packages required -Refer to the following links for assemblies and NuGet packages required based on platforms to convert between Markdown and HTML documents using the .NET Word Library. +Refer to the following links for the assemblies and NuGet packages required, based on the target platform, to convert between Markdown and HTML documents using the .NET Word Library. * [Markdown conversions assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required) * [Markdown conversions NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required) @@ -40,7 +40,7 @@ using (WordDocument document = new WordDocument(Path.GetFullPath("Input.md"))) //Open an existing Markdown file. using (WordDocument document = new WordDocument("Input.md")) { - //Save as a HTML document. + //Save as an HTML document. document.Save("Output.html"); } {% endhighlight %} @@ -48,7 +48,7 @@ using (WordDocument document = new WordDocument("Input.md")) {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Open an existing Markdown file. Using document As WordDocument = New WordDocument("Input.md") - 'Save as a HTML document. + 'Save as an HTML document. document.Save("Output.html") End Using {% endhighlight %} @@ -172,7 +172,7 @@ End Sub {% endtabs %} -N> Hook the event handler before opening a Markdown document as per the above code example. +N> Hook the event handler before opening a Markdown document as shown in the above code example. ### Encoding @@ -282,10 +282,10 @@ The following code example illustrates how to save Image files during an HTML to {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} -//Open an existing HTML document. +//Open an existing HTML document. using (WordDocument document = new WordDocument(@"Input.html")) { - //Hook the event to customize the image. + //Hook the event to customize the image. document.SaveOptions.MarkdownSaveOptions.ImageNodeVisited += SaveImage; //Save an HTML document as a Markdown file. document.Save("HtmlToMd.md", FormatType.Markdown); @@ -293,9 +293,9 @@ using (WordDocument document = new WordDocument(@"Input.html")) {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -'Open an existing HTML document. +'Open an existing HTML document. Using document As WordDocument = New WordDocument("Input.html") - 'Hook the event to customize the image. + 'Hook the event to customize the image. document.SaveOptions.MarkdownSaveOptions.ImageNodeVisited += SaveImage 'Save an HTML document as a Markdown file. document.Save("HtmlToMd.md", FormatType.Markdown) diff --git a/Document-Processing/Markdown/Conversions/markdown-to-pdf.md b/Document-Processing/Markdown/Conversions/markdown-to-pdf.md index f91f2327e4..39454df796 100644 --- a/Document-Processing/Markdown/Conversions/markdown-to-pdf.md +++ b/Document-Processing/Markdown/Conversions/markdown-to-pdf.md @@ -8,7 +8,7 @@ documentation: UG # Markdown to PDF Conversion -Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to PDF document. +Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to a PDF document. ## Assemblies and NuGet packages required @@ -21,7 +21,7 @@ Refer to the following links for assemblies and NuGet packages required based on Convert an existing markdown file to a PDF document using the .NET Word library. -The following code example shows how to convert Markdown to PDF document. +The following code example shows how to convert a Markdown file to a PDF document. N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. @@ -88,7 +88,7 @@ When opening an existing Markdown document, the .NET Word library provides custo The .NET Word library provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event. -The following code example shows how to load image data based on the image source path when importing the Markdown files. +The following code example shows how to load image data based on the image source path when importing the Markdown file. {% tabs %} diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Assemblies-Required.md b/Document-Processing/Markdown/Markdown-Library/NET/Assemblies-Required.md index 41ecd1db1d..971b64b410 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Assemblies-Required.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Assemblies-Required.md @@ -6,7 +6,7 @@ control: Markdown documentation: UG --- -# Assemblies Required for Markdown +# Assemblies Required for .NET Markdown Library The following assemblies need to be referenced in your application to use the .NET Markdown library. diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md b/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md index c8f04a539c..ea79173b8c 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md @@ -8,11 +8,11 @@ documentation: UG # Loading and Saving a Markdown Document -The Syncfusion® Markdown library allows you to load an existing Markdown document and save it to the file system or stream programmatically. +The Syncfusion® .NET Markdown library allows you to load an existing Markdown document and save it to the file system or stream programmatically. ## Namespaces required -The following namespaces of Essential® Markdown need to be included in your application to load and save the Markdown document. +The following namespaces need to be included in your application to load and save a Markdown document. N> Refer to the appropriate tabs in the code snippets section: ***C#*** for ASP.NET Core, Blazor, ASP.NET MVC, UWP, .NET MAUI, WinUI, WinForms and WPF; ***VB.NET*** for VB.NET applications. diff --git a/Document-Processing/Markdown/Markdown-Library/NET/NuGet-Packages-Required.md b/Document-Processing/Markdown/Markdown-Library/NET/NuGet-Packages-Required.md index fa83fbe66f..c33c8f4312 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/NuGet-Packages-Required.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/NuGet-Packages-Required.md @@ -6,11 +6,11 @@ control: Markdown documentation: UG --- -# NuGet Packages Required for Markdown Library +# NuGet Packages Required for .NET Markdown Library ## Installing Syncfusion® Markdown through NuGet Packages -NuGet is the one of the easiest way to download and install Markdown library to create, read, and edit the Markdown documents. The following NuGet packages need to be installed in your application. +NuGet is one of the easiest ways to download and install the Markdown library to create, read, and edit Markdown documents. The following NuGet package needs to be installed in your application.
-Custom Shapes +Custom Shapes Only DrawingML custom shapes in DOCX and WordML format documents are supported. @@ -62,7 +62,7 @@ Mathematical equations extending to multiple lines will be rendered in a single SmartArt -Supported only in DOCX format document to image. Additional behavior explained {{ '[here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#smartart)' | markdownify }}. +Supported only in DOCX format document to image. Additional behavior explained {{ '[here](https://help.syncfusion.com/document-processing/word/conversions/word-to-pdf/net/unsupported-elements-word-to-pdf#smartart)' | markdownify }}.
-First watermark of the Word document should be applied to the entire converted PDF document when the Word document have multiple watermarks. +First watermark of the Word document should be applied to the entire converted image when the Word document has multiple watermarks.
-Multi-Column text positions are calculated dynamically when layout the text. So, there may be some content position differences occur in the image. +Multi-Column text positions are calculated dynamically when layout the text. So, there may be some content position differences in the image.
-Number formats in Roman, Alphabets, and Arabic only supported. +Number formats in Roman, Alphabets, and Arabic are only supported.
-The Essential® DocIO makes sensible decision when layout the text, and its supported elements while generating the PDF documents. But however, there may not be guaranteed pagination with all the documents. +The Essential® DocIO makes sensible decisions when layout the text and its supported elements while generating the image documents. However, there may not be guaranteed pagination with all the documents.
-Using of patterns and 3D borders are not retained in the output image. +Use of patterns and 3D borders are not retained in the output image.
@@ -44,7 +44,7 @@ N> 2. Starting with v34.x.x, if you reference Syncfusion® assemblies from trial ## NuGet Package Installation and Uninstallation -To use Syncfusion® NuGet packages in your project, please refer the NuGet Package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections. +To use Syncfusion® NuGet packages in your project, refer to the NuGet package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections. Markdown NuGet packages can be installed and uninstalled using Package Manager Console. diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Overview.md b/Document-Processing/Markdown/Markdown-Library/NET/Overview.md index a91817e5e0..f482dadf11 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Overview.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Overview.md @@ -7,9 +7,9 @@ documentation: UG --- # Overview of Syncfusion® Markdown library -Essential® Markdown Document Processing library is a native .NET Markdown library that is used by developers to create, read, edit, and manage Markdown documents by using C#, VB.NET, and managed C++ code from any of the following .NET platforms — Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI applications. +Essential® Markdown Document Processing library is a native .NET library used by developers to create, read, edit, and manage Markdown documents in C# and VB.NET from Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI applications. -It is a non-UI component that provides a full-fledged document instance model to interact with the Markdown document elements programmatically and perform the necessary manipulation. The library is built from scratch in C# and does not require any Markdown editor or third-party tools to be installed on the machine. +It is a non-UI component that provides a full-fledged document instance model to interact with Markdown document elements programmatically and perform the required operations. The library is built from scratch in C# and does not require any Markdown editor or third-party tools to be installed on the machine. **Key Features** diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Image.md b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Image.md index 6e2743a56b..deef57e3ae 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Image.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Image.md @@ -8,11 +8,11 @@ documentation: UG # Working with Images in Markdown Library -Images are essential elements of Markdown documents that enhance visual communication and documentation. The Syncfusion® Markdown library facilitates adding, modifying, and managing images in a Markdown document. Images in Markdown are represented by the `MdPicture` class, which is an inline element that can be added to a `MdParagraph`. The library supports both URL-based and byte array-based images, allowing you to reference external image files or embed images directly into the document. +Images are essential elements of Markdown documents that enhance visual communication and documentation. The Syncfusion® .NET Markdown library facilitates adding, modifying, and managing images in a Markdown document. Images in Markdown are represented by the `MdPicture` class, which can be added to the inline collection of an `MdParagraph`. The library supports both URL-based and byte array-based images, allowing you to reference external image files or embed images directly into the document. Supported image formats include PNG, JPEG, BMP, GIF, WebP, and SVG. -When saving a Markdown document using the `Save(fileName)` overloads, the library creates a new folder parallel to the output file name and exports all the images into it as default. +When saving a Markdown document using the `Save(fileName)` overloads, the library creates a new folder parallel to the output file name and exports all the images into it by default. -When using the `Save(Stream)` overloads, the library preserves the images as base64 format in the output Markdown file as default. +When using the `Save(Stream)` overloads, the library preserves the images as base64 data URIs in the output Markdown file by default. If the image contains both a URL and stream values, or contains only a URL, the URL will be used in the output document. @@ -66,7 +66,9 @@ markdownDocument.Dispose() {% endtabs %} -## Adding image from file path +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-URL/.NET). + +## Adding an image from a file path The Syncfusion Markdown library supports adding images from file paths. The following code example demonstrates how to add an image from a file path. @@ -112,11 +114,13 @@ markdownDocument.Dispose() {% endtabs %} +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-local-file-path/.NET). + ## Adding image from image bytes -The Syncfusion Markdown library allows embedding images directly into a Markdown document using byte arrays. This is particularly useful when you need to include images that are dynamically generated, retrieved from a database, or loaded from memory. +The Syncfusion® .NET Markdown library allows embedding images directly into a Markdown document using byte arrays. This is useful when you need to include images that are dynamically generated, retrieved from a database, or loaded from memory. When the document is saved with the `Save(fileName)` overload, the bytes are written to the auto-generated images folder; when saved with the `Save(Stream)` overload, the bytes are embedded as a base64 data URI. -The following code example demonstrates how to add an image from a image bytes. +The following code example demonstrates how to add an image from a byte array. {% tabs %} @@ -164,7 +168,7 @@ markdownDocument.Dispose() {% endtabs %} - +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-image-bytes/.NET). ## Replacing images @@ -235,7 +239,7 @@ markdownDocument.Dispose() {% endtabs %} - +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Replacing-image/.NET). ## Removing images @@ -301,13 +305,13 @@ markdownDocument.Dispose() {% endtabs %} - +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Removing-image/.NET). ## Working with alternative text Alternative text (alt text) is essential for accessibility, providing textual descriptions of images for screen readers and situations where images cannot be displayed. The Syncfusion Markdown library allows you to set and modify alternative text for images using the `AltText` property. -The following code example demonstrates how to add descriptive alternative text to images. +The following code example demonstrates how to add descriptive alternative text to an image. {% tabs %} @@ -355,7 +359,7 @@ markdownDocument.Dispose(); {% endtabs %} - +A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-alternative-text/.NET). diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Paragraph.md b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Paragraph.md index 80b66f7a8d..00b8639e1c 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Paragraph.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-Paragraph.md @@ -178,7 +178,7 @@ markdownDocument.Dispose(); ## Applying paragraph styles -Paragraph styles define the visual appearance of a paragraph in a Markdown document. The Syncfusion Markdown library supports heading styles (Heading 1 through Heading 6), blockquote style, and the default normal paragraph style. You can apply a style to a paragraph by using the `ApplyParagraphStyle` method of the `MdParagraph` class. +Paragraph styles define the visual appearance of a paragraph in a Markdown document. The Syncfusion® .NET Markdown library supports heading styles (Heading 1 through Heading 6), the blockquote style, and the default paragraph style (Normal). You can apply a style to a paragraph by using the `ApplyParagraphStyle` method of the `MdParagraph` class. Omitting the call leaves the paragraph in the default Normal style. The following are the supported paragraph styles in the Syncfusion Markdown library: @@ -504,7 +504,7 @@ markdownDocument.Dispose() ## Working with hyperlinks -Hyperlink is a reference to data that can link to external content like images, files, webpage, and more. In a Markdown document, a hyperlink may target to any one of the following sources: +A hyperlink is a reference to data that can link to external content such as images, files, webpages, and more. In a Markdown document, a hyperlink may target any one of the following sources: * Webpage: Represents the web content. * File: Represents the file in some location. diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-code-blocks.md b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-code-blocks.md index f7534787f4..b98f25c7db 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-code-blocks.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-code-blocks.md @@ -8,18 +8,18 @@ documentation: UG # Working with Code Blocks -Code blocks are fundamental elements in technical documentation and Markdown documents used to display programming code, configuration files, command-line instructions, and other preformatted text. The Syncfusion® Markdown library enables you to create, modify, and manage code blocks programmatically in a Markdown document. Code blocks are represented by the `MdCodeBlock` class. +Code blocks are fundamental elements in technical documentation and Markdown documents. They are used to display programming code, configuration files, command-line instructions, and other preformatted text. The Syncfusion® .NET Markdown library enables you to create, modify, and manage code blocks programmatically in a Markdown document. Code blocks are represented by the `MdCodeBlock` class. ## Types of code blocks -The Syncfusion Markdown library supports two primary types of code blocks: +The Syncfusion® .NET Markdown library supports two primary types of code blocks: * **Fenced code blocks**: Code blocks enclosed with triple backticks (```) or triple tildes (~~~), allowing optional language specification for syntax highlighting. * **Indented code blocks**: Traditional code blocks created by indenting each line with four spaces or one tab. N> The `IsFencedCode` property controls the code block type. By default, code blocks are created as fenced code blocks. -## Creating fenced code blocks +## Creating a fenced code block You can add a code block to a `MarkdownDocument` by using the `AddCodeBlock` method. The following code example demonstrates how to create a fenced code block explicitly. @@ -124,10 +124,9 @@ markdownDocument.Dispose() {% endtabs %} +## Modifying an existing code block -## Modifying existing code blocks - -Existing code blocks in a parsed Markdown document can be modified by iterating through the blocks and updating the `Lines` collection. The following code example demonstrates how to modify code blocks. +Existing code blocks in a parsed Markdown document can be modified by iterating through the blocks and updating the `Lines` collection. The following code example demonstrates how to modify a code block. {% tabs %} diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-lists.md b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-lists.md index de1da27a9c..b430d50466 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-lists.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-lists.md @@ -8,9 +8,9 @@ documentation: UG # Working with Lists in Markdown Library -Lists are essential elements in Markdown documents that organize and present information in a hierarchical and structured manner. The Syncfusion® Markdown library supports creating, modifying, and managing both numbered (ordered) and bulleted (unordered) lists in a Markdown document. Lists are represented by the `MdListFormat` class, which can be applied to a `MdParagraph`. The library supports up to nine nesting levels (level 0 to level 8), allowing for complex hierarchical structures. +Lists are essential elements in Markdown documents that organize and present information in a hierarchical and structured manner. The Syncfusion® .NET Markdown library supports creating, modifying, and managing both numbered (ordered) and bulleted (unordered) lists in a Markdown document. Lists are not separate block types; they are produced by applying an `MdListFormat` instance to an `MdParagraph`. The library supports up to nine nesting levels (level `0` to level `8`), allowing for complex hierarchical structures. -The Syncfusion Markdown library supports two primary types of lists: +The Syncfusion® .NET Markdown library supports two primary types of lists: * **Numbered lists (Ordered lists)**: Lists with sequential numbering such as 1., 2., 3., etc. * **Bulleted lists (Unordered lists)**: Lists with bullet markers such as -, *, or +. @@ -101,7 +101,7 @@ markdownDocument.Dispose(); N> The `ListValue` property specifies the complete list prefix including the marker and spacing. For bulleted lists, typical values are "- ", "* ", or "+ ". -## Creating numbered list +## Creating a numbered list A numbered list can be created by setting the `ListFormat` property of a paragraph and `IsNumbered` property to true and configuring the appropriate marker. @@ -197,7 +197,7 @@ markdownDocument.Dispose() N> The `ListValue` property contains the actual number and marker for each item. -## Creating multilevel bulleted list +## Creating a multilevel bulleted list Multilevel bulleted lists can be created by varying the `ListLevel` property. The list level ranges from 0 (root level) to 8 (deepest nested level), supporting up to nine levels of nesting. @@ -333,9 +333,9 @@ The following code example demonstrates how to create a multilevel bulleted list N> Each nesting level typically adds spaces of indentation. Level 0 has no indentation. -## Creating multilevel numbered list +## Creating a multilevel numbered list -Multilevel numbered lists can be created by varying the `ListLevel` property. The list level ranges from 0 (root level) to 8 (deepest nested level), supporting up to nine levels of nesting. It combines hierarchical structure with sequential numbering at each level. +Multilevel numbered lists can be created by varying the `ListLevel` property. The list level ranges from `0` (root level) to `8` (deepest nested level), supporting up to nine levels of nesting. A multilevel numbered list combines a hierarchical structure with sequential numbering at each level. The following code example demonstrates how to create a multilevel numbered list. diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-tables.md b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-tables.md index 7e237631f5..75a825540d 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Working-with-tables.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Working-with-tables.md @@ -8,7 +8,9 @@ documentation: UG # Working with Tables in Markdown Library -Tables are essential components in Markdown documents used to organize and present data in a structured format of rows and columns. The Syncfusion® Markdown library provides comprehensive support for creating, modifying, and managing tables programmatically in a Markdown document. +Tables are essential components in Markdown documents used to organize and present data in a structured format of rows and columns. The Syncfusion® .NET Markdown library provides comprehensive support for creating, modifying, and managing tables programmatically in a Markdown document. + +A table is represented by the following DOM types: * **Table**: Represented by `MdTable`, which is the root container for rows. * **Rows**: Represented by `MdTableRow`, which contains a collection of cells. A table must contain at least one row (typically the header row). @@ -18,7 +20,7 @@ The first row in a Markdown table is typically treated as the header row, follow ## Adding a table -You can add a table to a `MarkdownDocument` by using the `AddTable` method. The alignment for each column can be specified using the `ColumnAlignments` property. The supported alignment options are Left, Center, and Right. +You can add a table to a `MarkdownDocument` by using the `AddTable` method. The alignment for each column can be specified using the `ColumnAlignments` property. The supported alignment options are `Left`, `Center`, and `Right`. The following code example demonstrates how to create a table diff --git a/Document-Processing/Markdown/Markdown-Library/overview.md b/Document-Processing/Markdown/Markdown-Library/overview.md index 51af779470..0b8208a600 100644 --- a/Document-Processing/Markdown/Markdown-Library/overview.md +++ b/Document-Processing/Markdown/Markdown-Library/overview.md @@ -9,7 +9,7 @@ keywords: markdown, SDK, Automation, API, create, read, edit # Welcome to Syncfusion® Markdown Document Processing Library -Syncfusion® Markdown Document Processing library is a .NET class library used to create, read, and edit Markdown documents through code in .NET [Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, .NET MAUI] applications without any external dependencies. +Syncfusion® .NET Markdown Document Processing library is a .NET class library used to create, read, and edit Markdown documents programmatically in Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI applications without any external dependencies. It supports various Markdown processing functionalities like creating headings, tables, lists, code blocks, hyperlinks, images, and more. Developers can simply integrate this library to achieve the required Markdown document processing functionalities and focus on the core application logic. diff --git a/Document-Processing/Markdown/overview.md b/Document-Processing/Markdown/overview.md index 53461884a3..98ff839395 100644 --- a/Document-Processing/Markdown/overview.md +++ b/Document-Processing/Markdown/overview.md @@ -9,10 +9,10 @@ keywords: markdown, SDK, Automation, API, create, read # Welcome to Syncfusion® Markdown Document Processing Framework -Syncfusion® Markdown Document Processing Framework is a collection of Markdown document processing library that works without any external dependencies. It eases the developers, as they can just integrate and achieve the required Markdown document processing functionalities and concentrate on core logics of their application. +Syncfusion® .NET Markdown Document Processing Framework is a collection of Markdown document processing library that works without any external dependencies. It eases the developers, as they can just integrate and achieve the required Markdown document processing functionalities and concentrate on core logics of their application. -## List of Markdown Document Processing Products: +## List of Markdown Document Processing Products -* Markdown Library - is a class library used to create, read, and edit Markdown documents through code in .NET [Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, .NET MAUI] applications. -* Markdown Conversions - is a class library that convert Markdown documents to Word, HTML, PDF, PowerPoint, Excel. It also supports convert Word, PDF, PowerPoint, Excel, HTML to Markdown documents. +* [Markdown Library](./Markdown-Library/overview) - a class library used to create, read, and edit Markdown documents through code in .NET (Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI) applications. +* [Markdown Conversions](./Conversions/overview) - a class library that converts Markdown documents to Word, HTML, PDF, PowerPoint, and Excel. It also supports converting Word, PDF, PowerPoint, Excel, and HTML to Markdown documents. From 3adac3ddfb7471cabe91f77624a3f14cad3d75ba Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 13:13:18 +0530 Subject: [PATCH 5/7] Removed unwanted comments in Loading-and-Saving-document.md --- .../Markdown-Library/NET/Loading-and-Saving-document.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md b/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md index ea79173b8c..1b86ab25a3 100644 --- a/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md +++ b/Document-Processing/Markdown/Markdown-Library/NET/Loading-and-Saving-document.md @@ -283,7 +283,6 @@ MarkdownDocument markdownDocument = new MarkdownDocument(); // Opens an existing Markdown document using the Open method. markdownDocument.Open("Input.md"); // To-Do some manipulation -// To-Do some manipulation // Saves the Markdown document to the file system markdownDocument.Save("Output.md"); // Disposes the document to release all memory @@ -298,7 +297,6 @@ Dim markdownDocument As New MarkdownDocument() ' Opens an existing Markdown document using the Open method. markdownDocument.Open("Input.md") 'To-Do some manipulation -'To-Do some manipulation ' Saves the Markdown document to the file system markdownDocument.Save("Output.md") ' Disposes the document to release all memory @@ -323,7 +321,6 @@ MarkdownDocument markdownDocument = new MarkdownDocument(); // Opens an existing Markdown document using the Open method. markdownDocument.Open("Input.md"); // To-Do some manipulation -// To-Do some manipulation // Creates an instance of memory stream MemoryStream stream = new MemoryStream(); // Saves the Markdown document to the stream @@ -340,7 +337,6 @@ Dim markdownDocument As New MarkdownDocument() ' Opens an existing Markdown document using the Open method. markdownDocument.Open("Input.md") 'To-Do some manipulation -'To-Do some manipulation 'Creates an instance of memory stream Dim stream As New MemoryStream() ' Saves the Markdown document to the stream @@ -453,7 +449,6 @@ The following code example demonstrates how to get the Markdown content as text. // Opens an existing Markdown document. MarkdownDocument markdownDocument = new MarkdownDocument("Input.md"); // To-Do some manipulation -// To-Do some manipulation // Retrieves the Markdown document content as text. string mdContent = markdownDocument.GetMarkdownText(); // Disposes the document to release all memory @@ -466,7 +461,6 @@ markdownDocument.Dispose(); ' Opens an existing Markdown document. Dim markdownDocument As MarkdownDocument = New MarkdownDocument("../../Data/Input.md") ' To-Do some manipulation -' To-Do some manipulation ' Retrieves the Markdown document content as text. Dim mdContent As String = markdownDocument.GetMarkdownText() ' Disposes the document to release all memory @@ -491,7 +485,6 @@ Once the document manipulation and save operations are completed, you should clo // Opens, saves and closes a Markdown document. MarkdownDocument markdownDocument = new MarkdownDocument("Input.md"); -// To-Do some manipulation // To-Do some manipulation // Saves the Markdown document to the file system @@ -507,7 +500,6 @@ markdownDocument.Dispose(); ' Opens, saves and closes a Markdown document. Dim markdownDocument As New MarkdownDocument("Input.md") -'To-Do some manipulation 'To-Do some manipulation ' Saves the Markdown document to the file system From 0f9124b268ee269d0368d30717bcc0a5ee6a0a05 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 17:14:22 +0530 Subject: [PATCH 6/7] Resolved CI issues --- .../Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md index 7f975d3aa9..c665d245ab 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md @@ -1,5 +1,5 @@ --- -title: Word to PDF Conversion FAQs | DocIO | Syncfusion +title: Word to PDF conversion FAQs | DocIO | Syncfusion description: Find answers to common questions about converting Word documents to PDF using using .NET Word (DocIO) library without Microsoft Word or interop dependencies. keywords: Word to PDF FAQ, DocIO FAQ, Word conversion FAQ, chart conversion, Azure, content controls, multithreading platform: document-processing @@ -7,7 +7,7 @@ control: DocIO documentation: UG --- -# Frequently Asked Questions (Word to PDF) +# Frequently Asked Questions (Word-to-PDF) The frequently asked questions about Word to PDF conversion in Essential® DocIO are listed below. From e52d98da253737c2384b31bda5515e68f89e51c8 Mon Sep 17 00:00:00 2001 From: Viswajith-SF4658 Date: Fri, 24 Jul 2026 17:56:58 +0530 Subject: [PATCH 7/7] Resolved CI issue --- .../Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md index c665d245ab..7900d986ae 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/NET/Faqs-word-to-pdf.md @@ -1,5 +1,5 @@ --- -title: Word to PDF conversion FAQs | DocIO | Syncfusion +title: Word-to-PDF conversion FAQs | DocIO | Syncfusion description: Find answers to common questions about converting Word documents to PDF using using .NET Word (DocIO) library without Microsoft Word or interop dependencies. keywords: Word to PDF FAQ, DocIO FAQ, Word conversion FAQ, chart conversion, Azure, content controls, multithreading platform: document-processing