Use version 24.10
var doc = new Aspose.Words.Document(docStream);
doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
doc.Save(outStream, new PdfSaveOptions
{
Compliance = PdfCompliance.PdfA1a,
});
Use version 24.10
var doc = new Aspose.Words.Document(docStream);
doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
doc.Save(outStream, new PdfSaveOptions
{
Compliance = PdfCompliance.PdfA1a,
});
@mkn1993 The problem occurs be cause PdfA1 compliance does not support transparency. Please consider using PdfA2 compliance instead:
Document doc = new Document(@"C:\Temp\in.docx");
PdfSaveOptions opt = new PdfSaveOptions();
opt.Compliance = PdfCompliance.PdfA2a;
doc.Save(@"C:\Temp\out.pdf", opt);
PdfCompliance.PdfA1b is obsolete: PDF/A-1 have significant limitations which are removed in PDF/A-2.
When converting a DOCX document to PDF using Aspose.Words, some users have reported issues where transparent PNG images lose their transparency and appear non-transparent in the resulting PDF. This issue has been acknowledged and logged in the Aspose issue tracking system.
To address this problem, it is recommended to ensure that you are using the latest version of Aspose.Words, as fixes for such issues are often included in newer releases. The specific issue related to transparent PNG images was resolved in version 21.7 of Aspose.Words. Therefore, if you are using version 24.10, you should not encounter this problem, but if you do, it may be worth checking if the images are correctly formatted and if any specific settings in your code might be affecting the output.
Here is a sample code snippet for converting a DOCX to PDF while ensuring that the layout options are set correctly:
var doc = new Aspose.Words.Document(docStream);
doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
doc.Save(outStream, new PdfSaveOptions
{
Compliance = PdfCompliance.PdfA1a,
});
If you continue to experience issues with transparency in PNG images, consider reaching out to Aspose support for further assistance or checking the latest updates in the documentation for any additional settings that may help.
For more information, you can refer to the following sources:
[1]: Transparent PNG image became non-transparent when converting DOCX to PDF