The following word document is not being rendered correctly when converted to PDF, part of the image in the document is being overlapped by a white square…
TestDoc.7z (101.0 KB)
The following code reproduces the issue with Aspose 22.9…
public static void ConvertToPDF(string testFile)
{
FileInfo file = new FileInfo(testFile);
Assert.IsTrue(file.Exists);
string pdfFileName = Path.Combine(
Path.GetDirectoryName(testFile),
$"{ DateTime.Now:yyyyMMdd - HHmm - ss}_{ Path.GetFileNameWithoutExtension(testFile)}.pdf");
if (File.Exists(pdfFileName))
File.Delete(pdfFileName);
var format = Aspose.Words.Saving.SaveOptions.CreateSaveOptions(pdfFileName).SaveFormat;
using (var outputStream = File.Create(pdfFileName))
{
using (var inputStream = File.OpenRead(testFile))
{
Document wordDocument = new Document(inputStream);
wordDocument.Save(outputStream, format);
}
}
}
This is possibly related to…
https://forum.aspose.com/t/issue-converting-word-document-containing-a-chart-to-a-pdf/245482