Hello Alexey.
The files I sent haven't been updated before the conversion. I've also tried using my code that worked with Words 5.2.0.0, but with Words 6.0. and I still get the same error. It fails on the line that binds the XML (which a guess is what it does behind the scenes with the new .SavetoPDF method).
I don't really want to have to go back to Words 5.2.0.0, because we've installed 6.0, which other shared components are now ok using.
thanks, jacqui
Here's the code. The line the error occurs is bold
Protected Function ConvertDocToPdf(ByVal outputFile As String) As Boolean
Dim result As Boolean = False
Dim xmlFile As String = outputFile.ToLower.Replace(".pdf", ".xml")
If File.Exists(outputFile) Then
outputFile = outputFile.Replace(".pdf", Format(Now(), "-yyMMddHHmmss") & ".pdf")
End If
'Convert to aspose pdf xml
Dim doc As Aspose.Words.Document = New Aspose.Words.Document(MyBase.SourceFilename, LoadFormat.Doc, String.Empty)
doc.Save(xmlFile, SaveFormat.AsposePdf)
doc = Nothing
'Read the document in Aspose.Pdf.Xml format into Aspose.Pdf.
_pdf.BindXML(xmlFile, Nothing)
'Delete temporary image files created during the conversion to xml.
_pdf.IsImagesInXmlDeleteNeeded = True
'Enable the caching of True type font map on disk
_pdf.IsTruetypeFontMapCached = True
'Set the path of True type font map file
_pdf.TruetypeFontMapPath = System.IO.Path.GetTempPath()
'Try and save the PDF. Need to do this on a seperate thread and
'throw an exception if it takes too long, because Aspose.PDF doesn't
'throw an exception. If it can't save it just hangs(Aspose defect PDFNET-5394)
Dim d As SavePDFDelegate = New SavePDFDelegate(AddressOf SavePDF)
Dim res As IAsyncResult = d.BeginInvoke(outputFile, Nothing, Nothing)
If res.IsCompleted = False Then
res.AsyncWaitHandle.WaitOne(10000, False)
If res.IsCompleted = False Then
Throw New AsposeWordToPDFTimeoutException()
End If
End If
'Tidy Up
_pdf = Nothing
If File.Exists(xmlFile) Then
File.Delete(xmlFile)
End If
result = True
Return result
End Function
Private Function SavePDF(ByVal outputfile As String) As Boolean
Dim result As Boolean = False
_pdf.Save(outputfile)
result = True
Return result
End Function