Word DOC to PDF converting issue

Hello,

I have an issue when I try convert DOC file I attached to PDF.
I also attached PDF file I created using Aspose Words and MS Word API for developers.

Could you please tell me any advice?

Mikhael
word2pdf report files.zip (481.6 KB)

@Mikhael This document is protected. I have created a sample document with date fields and everything looks correct. Could you please create an unprotected document with a problem so we can examine this document and the problem?

@vyacheslav.deryushev ,

It seems, that I cannot understand your message about protected DOC file.

I used code snippet you can see below to convert it using Aspose.Words. Could you please tell me if you receive any error message or exception if you try use the same code to convert “HH040398.DOC” to PDF?

Mikhael

'''
Dim sSrcFile = "C:\in\HH040398.DOC"
Dim sOutPDF = "C:\out\aspose - DOC to pdf.pdf"

Dim doc As New Aspose.Words.Document(sSrcFile)

Dim soPDF As Aspose.Words.Saving.PdfSaveOptions = Aspose.Words.Saving.SaveOptions.CreateSaveOptions(Aspose.Words.SaveFormat.Pdf)

soPDF.Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1b

doc.Save(sOutPDF, soPDF)
'''

@Mikhael I meant your document is blocked to any changes in the MS Word. It looks like this field contains link that doesn’t exist and when Aspose.Words trying to update fields it’s breaking this field. You can disable updating fields during conversion:

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.UpdateFields = false;

doc.Save("output.pdf", saveOptions);

@vyacheslav.deryushev ,

Thank you for great advice!

Mikhael

1 Like