Frequently asked questions about Word to PDF and image conversions

12 Sep 20243 minutes to read

The frequently asked questions about Word to PDF and image conversions using 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?

Yes, OfficeChartToImageConverter assembly is not supported in .NET 3.5 Framework and it is available in .NET 4.0 Framework.

Is it possible to convert 3D charts to PDF or image?

Current version of the DocIO library does not provide support for converting 3D charts to PDF or image format.

Is it possible to specify PDF conformance level in Word to PDF conversion?

Yes, you can specify the PDF conformance level in Word to PDF conversion. For more details, refer PDF Conformance.

Which one is better Azure App Service or Cloud Service for Word to PDF or image using DocIO?

When the Word document contains metafile images (*.emf or *.wmf), we recommend using Azure Cloud Service.

We have found metafile images (*.emf, *.wmf) that are not supported in Azure App Service while converting a Word document with metafile images into PDF or image. And also, this is one of the known limitations in Azure App Service. In this scenario, internally, Essential DocIO preserves RedX images in the same size during the Word to PDF or image conversion to avoid pagination problems.

Why images are preserved as RedX images in Word to PDF or image conversion?

In .NET Core or .NET targeting applications, metafile (*.wmf, *.emf) images have some limitations in DocIORenderer. Internally, DocIORenderer used the SkiaSharp graphics library to layout the text and images in PDF or image conversion. And SkiaSharp library does not support the metafile (“.emf”, “.wmf”) images, so, it does not preserve the images in the mentioned applications.

Starting from version 27.x.x, the .NET Word Library (DocIO) uses its own Metafile renderer to preserve EMF images during Word to PDF or image conversions. However, it does not support converting certain metafile formats, including WMF, EMF Plus, EMF Dual, and EMF Spool files. If a Word document contains these types of images, DocIO preserves them as RedX images with the original image size during conversion to avoid pagination problems.

To preserve the expected images in the PDF or image conversion, we suggest you convert the metafile image formats to bitmap image format (JPEG or PNG) and then perform Word to PDF or image conversion.

Suggestions:

  1. You can convert metafile image format to bitmap image format in the Word document using DocIO, you can refer to KB documentation link: Convert and replace metafile image in word document to bitmap. As this approach uses System.Drawing.Common, it is known limitation in Linux or cross platforms.

  2. Otherwise, you can use the WPF or Windows Forms platform NuGet packages for .NET Core 3.0 or later versions targeting applications from v17.3.0.x and use the same C# tab code examples for it. But in Mac and Linux environment, using the WPF or Windows Forms platform NuGet packages have limitations.

Why are content controls not preserved as editable form fields in the converted PDF document even when PreserveFormFields is enabled?

Content controls behave differently from legacy form fields, such as Text, Checkbox, and Drop-down fields, during conversions to PDF format. While legacy form fields are typically preserved as editable form fields in the resulting PDF document, content controls are converted to plain text. The PreserveFormFields API specifically retains the interactive nature of legacy form fields, not content controls.
To ensure that form fields remain editable in the PDF converted from Word document, it is recommended to use Text, Checkbox, and Drop-down form fields instead of content controls in the Word document. Additionally, to preserve the form fields as editable in the resulting PDF, set the PreserveFormFields API to true.

You can download a complete working sample from GitHub.