Hi
Converting a Docx document to PDF with Aspose.Words save method results in missing page.
Behaviour started from (including) version 19.4.
(I have all versions from 19.1 to 19.10(including))
Here is my code (vb.net subroutine):
'*********************************************************************************************
private sub ConvertWordDocumentToPdfUsingAsposeWords(sourcePathAndFileName As String, destinationPathAndFileName As string )
Using srcStream As New FileStream(sourcePathAndFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
Dim sourceDocument As New Aspose.Words.Document(srcStream)
Dim resultStream As New MemoryStream()
sourceDocument.Save(resultStream, Aspose.Words.SaveFormat.Pdf)
Using writeStream As FileStream = New FileStream(destinationPathAndFileName, FileMode.Create, FileAccess.Write)
resultStream.WriteTo(writeStream)
End Using
End Using
End sub
'**************************************************************************************************************
The method is straightforward: Recieves path and filename for Docx to be converted and path+ filename for the resulting PDF.
(example use:
ConvertWordDocumentToPdfUsingAsposeWords("C:\temp\DocumentWithPicturePages_Page4Image_missing_after_conversion.Docx", "c:\Test\DocumentWithPicturePages.PDF")
I have attached a docx that you can use to reproduce(“DocumentWithPicturePages_Page4Image_missing_after_conversion.Docx” (zipped)
I have also attached my resulting document(“DocumentWithPicturePages.PDF” (Zipped))
Observe that document has 4 pages with pictures: page 2, page 3, page 4 and page 5
After conversion we see that page 4 is missing.DocumentWithPicturePages_Page4Image_missing_after_conversion.zip (89.1 KB)DocumentWithPicturePages.zip (120.9 KB)