Transparent watermark on image in Word is KO'd after PDF generation

Hello,

We are currently using Syncfusion DocIO/DocIORenderer version 20.3.0.47.


We can't superimpose an image (pdf or png) and a Word watermark (with transparency). It's OK in Word, but not in the generated PDF file.

We tried moving the image to the background, and the watermark to the foreground.


The watermark is always under the image, and is therefore unreadable.

However, PDF export from Word works.


Updating to the latest version of Syncfusion doesn't seem to solve the problem.


Do you have any advice for generating the document in Word?

Is this a case handled by the library?


Thanks,

Adrien



3 Replies

SB Suriya Balamurugan Syncfusion Team May 26, 2023 02:03 PM UTC

Hi Adrien,

On further analyzing the reported problem, we have found that the watermark shape resides inside the header or footer of the Word document and main content is inside the body of the Word document. If you insert a watermark using the Microsoft Word application, you will observe the same behavior. All content of the document's header/footer is always behind the main content of the document. Our DocIO library follows the same behavior as the Microsoft Word application. Therefore, it is not possible to move the image to the background and bring the watermark to the foreground.

Regards,
Suriya Balamurugan.



AJ Adrien JUDET May 26, 2023 02:31 PM UTC

Hello suriya,

Thank you for your quick feedback,


Please find attached an archive with 3 files.

A Word file (my source file)

A PDF file generated from Word (OK)

A PDF file generated via Syncfusion (KO)


And the code i'm using to convert to PDF

using Stream st = new MemoryStream(docFile);
using WordDocument wordDocument = new WordDocument(st, Syncfusion.DocIO.FormatType.Automatic);
using DocIORenderer render = new DocIORenderer();

render.Settings.ChartRenderingOptions.ImageFormat = Syncfusion.OfficeChart.ExportImageFormat.Jpeg;
PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
using MemoryStream outputStream = new MemoryStream();
pdfDocument.Save(outputStream);

return outputStream.ToByteArray();


Please note that a 30% transparency is applied to the foreground image. This transparency should allow you to see the watermark as on the PDF generated from Word.


Thank you very much,

Adrien


Attachment: syncfusion_document_example_9cfc9842.zip


SB Suriya Balamurugan Syncfusion Team May 26, 2023 03:50 PM UTC

Hi Adrien,

Currently, the Syncfusion Word (DocIO) library does not support to preserve transparent picture in Word to PDF conversion. We have already logged this as a feature request in our database. However, we do not have any immediate plans to implement this feature. During the planning stage for each release cycle, we review all open features. We will notify you once this feature has been implemented.

You can track the status of this feature using the following feedback link:

https://www.syncfusion.com/feedback/39988/provide-support-to-preserve-transparent-picture-in-word-to-pdf-and-image

As a workaround solution, we have transparency support for picture fill in the shapes. So, we suggest you to modify your input document in Microsoft Word application by adding the textbox, fill with picture and set the transparency as shown below. Then convert the modified Word document to PDF using DocIO.

Insert -> Shapes -> Add Text Box-> Right click Format Shape-> Shape Options -> Fill -> Picture Fill -> Transparency


We have modified the input document as mentioned above, and it can be downloaded from the below attachment.

Regards,
Suriya Balamurugan.


Attachment: word_document_Modified_f2439f60.zip

Loader.
Up arrow icon