Hello
We are using Aspose Words Version 23.1.0 on Windows Server 2022 with .NET Core 7.
When doing new Document(wordfile) and then storing the document as pdf, if the Word-file contains a white text with colored background, the text consistently turns black in the pdf (storing it back to word has white text like expected).
This only happens on the server, when running locally from my IDE the text appears white also in the pdf.
How do we solve this?
@mariingberg Could you please attach your source and output documents (bot the problematic and correct ones) here for testing? We will check the issue and provide you more information.
1 Like
I have quite a large code base, but if I strip it down to where we use the library these are the lines that we use. Line 3 can be anything since the attached template.docx does not contain any syntax from Linq Reporting Engine which we use in the real templates. I tested on the server (running a quite stripped Windows docker image) with the given template.docx, and the two output files are the ones that were generated.
The custom font that we use is installed in the docker container and seems to be available, just the text color that is off. I also tried with a green color on the text, and it also became black.
ReportingEngine engine = new ReportingEngine();
Document templateDoc = new Document("template.docx");
engine.BuildReport(templateDoc, input, "ds");
templateDoc.Save("output.pdf");
template.docx (11.8 KB)
output.docx (9.2 KB)
output.pdf (15.4 KB)
I should mention we also have dependency to SkiaSharp.NativeAssets.NanoServer version 2.88.3
@mariingberg Though SkiaSharp
does not throw on Nano Server when SkiaSharp.NativeAssets.NanoServer
is used. SkiaSharp
still does not work well on Nano Server. I would suggest you to use Windows Server Core image. Try using the following tag 7.0-windowsservercore-ltsc2022
. By the way in this case no additional SkiaSharp.NativeAssets
packages are required.
1 Like
Thank you! Upgraded to Windows Server Core image, removed SkiaSharp package, and now the text show as white as expected!
1 Like