From d3b14b6561a4002cdc77c79b5e2fee7b53451c00 Mon Sep 17 00:00:00 2001 From: Karan-SF4772 Date: Tue, 11 Nov 2025 18:30:32 +0530 Subject: [PATCH 1/3] Added the Apply Matte API details --- .../Word-To-PDF/NET/Word-to-pdf-settings.md | 74 +++++++++++++++++++ .../Word-To-PDF/NET/word-to-pdf.md | 4 + .../Word/Conversions/Word-To-PDF/overview.md | 4 + 3 files changed, 82 insertions(+) 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 274f2c4a7..f102feba5 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 @@ -1350,3 +1350,77 @@ document.Close() {% endtabs %} You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Word-to-PDF-Conversion/Restrict-permission-in-PDF). + +## 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. + +The following code sample shows how to apply a matte color to transparent images during Word to PDF conversion. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} + +FileStream fileStream = new FileStream("Template.docx", FileMode.Open); +// Loads an existing Word document +WordDocument wordDocument = new WordDocument(fileStream, FormatType.Docx); +// Instantiates DocIORenderer instance for Word to PDF conversion +DocIORenderer renderer = new DocIORenderer(); +// Set to true to apply a matte color to transparent images. +renderer.Settings.ApplyMatteToTransparentImages = true; +// 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 +pdfDocument.Save(@"../../../Output/Result.pdf"); +// Closes the instance of PDF document object +pdfDocument.Close(); + +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} + +// Loads an existing Word document +WordDocument wordDocument = new WordDocument("Template.docx"); +// Creates an instance of the DocToPDFConverter - responsible for Word to PDF conversion +DocToPDFConverter converter = new DocToPDFConverter(); +// Set to true to apply a matte color to transparent images. +converter.Settings.ApplyMatteToTransparentImages = true; +// Converts Word document into PDF document +PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument); +// Closes the instance of Word document object +wordDocument.Close(); +// Releases the resources occupied by DocToPDFConverter instance +converter.Dispose(); +// Saves the PDF file +pdfDocument.Save(@"../../../Output/Result.pdf"); +// Closes the instance of PDF document object +pdfDocument.Close(); + +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} + +' Loads an existing Word document +Dim wordDocument As New WordDocument("Template.docx") +' Creates an instance of the DocToPDFConverter - responsible for Word to PDF conversion +Dim converter As New DocToPDFConverter() +' Set to true to apply a matte color to transparent images +converter.Settings.ApplyMatteToTransparentImages = True +' Converts Word document into PDF document +Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument) +' Closes the instance of Word document object +wordDocument.Close() +' Releases the resources occupied by DocToPDFConverter instance +converter.Dispose() +' Saves the PDF file +pdfDocument.Save("../../../Output/Result.pdf") +' Closes the instance of PDF document object +pdfDocument.Close() + +{% endhighlight %} + +{% endtabs %} \ No newline at end of file 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 9ea5dc734..8add1f51d 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 @@ -238,6 +238,10 @@ You can preserve Ole Equation as bitmap image in the converted PDF document. For 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). +### 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#restrict-all-permission-in-a-pdf-document). + ## 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. diff --git a/Document-Processing/Word/Conversions/Word-To-PDF/overview.md b/Document-Processing/Word/Conversions/Word-To-PDF/overview.md index f4300b5ce..d12c49d8f 100644 --- a/Document-Processing/Word/Conversions/Word-To-PDF/overview.md +++ b/Document-Processing/Word/Conversions/Word-To-PDF/overview.md @@ -240,6 +240,10 @@ You can preserve Ole Equation as bitmap image in the converted PDF document. For 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). +### 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#restrict-all-permission-in-a-pdf-document). + ## 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. From d71cd513ca03b49d4f5ba4bc1e23d66df2e7f841 Mon Sep 17 00:00:00 2001 From: Karan-SF4772 Date: Wed, 12 Nov 2025 18:20:51 +0530 Subject: [PATCH 2/3] Resolved CI issue --- .../Word/Conversions/Word-To-PDF/NET/word-to-pdf.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8add1f51d..67c8528cc 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 @@ -1,12 +1,12 @@ --- title: Convert Word to PDF in C# | DocIO | Syncfusion -description: Learn how to convert a Word document to PDF, PDF/A, and PDF/UA using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. +description: Learn how to convert a Word document to PDF, PDF/A, and PDF/UA using the .NET Word library (DocIO) without Microsoft Word or interop dependencies. platform: document-processing control: DocIO documentation: UG --- -# Convert Word to PDF using Syncfusion® Word (DocIO) library +# Convert Word to PDF using Syncfusion® Word (DocIO) library Syncfusion® 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. From 3d6bbf36e8d5fd628ffbb9a17dbc7c2a60778c3b Mon Sep 17 00:00:00 2001 From: Karan-SF4772 Date: Wed, 12 Nov 2025 18:30:24 +0530 Subject: [PATCH 3/3] resolved CI issue --- .../Word/Conversions/Word-To-PDF/NET/word-to-pdf.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 67c8528cc..f1faf36ea 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 @@ -1,6 +1,6 @@ --- -title: Convert Word to PDF in C# | DocIO | Syncfusion -description: Learn how to convert a Word document to PDF, PDF/A, and PDF/UA using the .NET Word library (DocIO) without Microsoft Word or interop dependencies. +title: Convert Word to PDF in C# using DocIO | Syncfusion +description: Learn how to convert a Word document to PDF, PDF/A, and PDF/UA using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. platform: document-processing control: DocIO documentation: UG