I am trying to open a DOCX file with Aspose.Words and ship it to Aspose.PDF without writing to disk. I am then saving the PDF to disk from Aspose.PDF. The resulting PDF file prints with missing characters when I use Aspose.PDF.Kit’s PDF Viewer.
Dim oDocxWords As New Aspose.Words.Document(sDocXFile)
Dim oPDF As New Aspose.Pdf.Pdf
Dim strmPDF As IO.Stream = New IO.MemoryStream
oDocxWords.Save(strmPDF, Aspose.Words.SaveFormat.AsposePdf)
oPDF.BindXML(strmPDF, Nothing)
…
oPDF.Save(sPDFFile)
…
Dim oViewer As New Aspose.Pdf.Kit.PdfViewer
Dim oPrintersettings As New System.Drawing.Printing.PrinterSettings
Dim oPageSettings As System.Drawing.Printing.PageSettings = oPrintersettings.DefaultPageSettings
oViewer.AutoResize = True
oViewer.AutoRotate = True
oViewer.OpenPdfFile(sPDFFile)
oViewer.PrintDocumentWithSettings(oPageSettings, oPrintersettings)
oViewer.ClosePdfFile()
Hello!
Thank you for your inquiry.
When I’m trying to open this document with Microsoft Word 2007 it crashes. Evidently that’s something wrong with the document itself. Can you open it with Microsoft Word on your computer?
Regards,
Thanks for your inquiry. I managed to reproduce the problem on my side. Your request is linked to the appropriate issue and you will be notified as soon as the problem is resolved.
Best regards,
Thanks for your inquiry. Currently I cannot provide you any reliable estimate regarding this issue. You will be notified as soon as it is fixed.
Best regards,
Thanks for your request. It seems the problem was fixed. Could you please try using the latest version of Aspose.Words (9.0.0) and direct method of PDF conversion?
Please try using the following code to convert your document to PDF:
Document doc = new Document("Test.docx");
doc.SaveToPdf("out.pdf");
The new version of Aspose.Words (9.0.0) seems to have fixed the missing characters when saving as AsposePdf and then using the BindXML method on Aspose.Pdf.Pdf. I did notice that the horizontal line under the document header appears to be shifted upwards compared to the original DOCX file.
We have been using the SaveToPDF() method as a workaround but there are times when we need to export the data to Aspose.Pdf.Pdf instead of directly to a PDF file.
Thank you for additional information. Legacy method of PDF conversion (Aspose.Words+Aspose.Pdf) is old method, you can use it, but you should note that we will exclude legacy method in one of our future versions. Also no new issues will be fixed in the legacy method.
Best regards,