Hi Team,
When I convert a document from pdf to png image format by using Aspose.Words dll, the font styles are not getting converted properly and the fonts used on the original document is totally off.
Specifications:
.NET Framework = .NET 6.0
Library = Aspose.Words.dll v.22.6.0
Hosting Server = Rocky Linux
So far, I have tried below options as per the Aspose documentation, but unfortunately nothing worked out.
Reference : How to Run Aspose.Words in Docker|Aspose.Words for .NET
- Installed “SkiaSharp.NativeAssets.Linux” and also installed libfontconfig1. This option is not working.
- Installed “SkiaSharp.NativeAssets.Linux.NoDependencies” and it is also not working.
Could you please suggest how can we resolve this issue as it is a core part of our project development.
Thanks.
@rpostdev Could you please attach your document here for testing. Also, please try using direct conversion form PDF to image:
Aspose.Words.Pdf2Word.FixedFormats.PdfFixedRenderer pdfRenderer = new Aspose.Words.Pdf2Word.FixedFormats.PdfFixedRenderer();
using (FileStream pdfStream = File.OpenRead(@"C:\Temp\in.pdf"))
{
IReadOnlyList<Stream> images = pdfRenderer.SavePdfAsImages(pdfStream);
for (int frameIdx = 0; frameIdx < images.Count; frameIdx++)
{
using (Stream imgStream = images[frameIdx])
using (FileStream imgFile = File.Create(string.Format(@"C:\Temp\out_{0}.png", frameIdx)))
{
imgStream.CopyTo(imgFile);
}
}
}
While loading PDF document into Document
object, Aspose.Words converts Fixed Page Document structure into the Flow Document Object Model. Unfortunately, such conversion does not guaranty 100% fidelity. The above method of conversion avoids conversion from Fixed Page Document structure into the Flow Document Object Model and Fixed Page PDF is directly converted to image.
@alexey.noskov
Please find the attached document for your testing purpose.
Calibration doc.pdf (92.6 KB)
Also, thanks for your suggestion. We will try and keep you updated with the status.
@rpostdev I have checked with the direct conversion from PDF to PNG and see the difference in fonts on Linux. I have logged the problem as WORDSNET-24757. We will investigate the issue and let you know one it is resolved or we have more information for you.
@alexey.noskov Could you please share any update on this ticket.
Please let us know if you can provide a separate Dll with this fix.
@rpostdev Unfortunately, there are no news regarding the issue yet. It is currently in the queue for analysis. We will be sure to keep you updated and let you know once the issue is resolved or we have more information for you.
@alexey.noskov Could you please share any update on this as our project implementation depends on this fix.
Is there any tentative date that you can provide for the resolution?
@rpostdev Unfortunately there is no estimate available for this issue yet. Currently, Pdf2Word does not use the fonts from the PDF document, it uses available system fonts or Fanwood
font.
We will keep you updated and let you know once the issue is resolved or we have more information for you. Please accept our apologies for your inconvenience.
@alexey.noskov We are still waiting on this issue to be resolved. There are many use cases similar to this issue with different documents.
Could you please share the update on this issue?
So that we can share the same information with our customers.
@rpostdev Unfortunately, the issues is not yet scheduled for development. I have asked the responsible development to take a look at this issue again and schedule it for development is possible. Please accept our apologies for your inconvenience.
@alexey.noskov Could you please share the timelines.
So that it will be helpful for us to make effective communication with our customers.
@rpostdev Unfortunately, at the moment we cannot provide you any estimates, since the issue is not yet scheduled for development. We will let you know once we have more information for you.
@alexey.noskov Could you please share an update on this issue as it is a critical issue for our project?
@rpostdev Unfortunately, the issue is still not resolved. We will keep you updated and let you know once it is resolved or we have more information for you.