We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error Converting PDF to Docx - OutOfMemoryException

I get System.OutOfMemoryException while saving a PDF as DOCX in Aspose.PDF version and

I used the following code:

Using pdf As New Aspose.Pdf.Document(sourceFile.FullName)
Dim dso As New Aspose.Pdf.DocSaveOptions()
dso.Mode = Aspose.Pdf.DocSaveOptions.RecognitionMode.Flow
dso.Format = Aspose.Pdf.DocSaveOptions.DocFormat.DocX
' Set the Horizontal proximity as 2.5
dso.RelativeHorizontalProximity = 2.5F
dso.RecognizeBullets = True
pdf.Save(targetFile.Fullname, dso)
End Using

It works when I switch RecognitionMode to "TextBox" but I would like to use "Flow"

Stacktrace: bei System.Collections.Generic.List`1.set_Capacity(Int32 value)
bei System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
bei .a.a(Int32 , List`1 , Rectangle , Rectangle )
bei .a.(List`1 , List`1 , Int32[,] , Int32[,] , Int32 , Int32 , Int32 , Int32 )
bei .a.(Byte[,] )
bei ..(˜” , Single , Single ,  , Boolean )
bei ..(˜” , Single , Single )
bei ..e(˜” , SizeF )
bei .Œ.Convert(List`1 , Œ , ‘ )
bei Œ.‹.‰’(List`1 )
bei š..‚(‹ , Queue`1 )
bei š..Convert(Document , Stream , DocSaveOptions )
bei Aspose.Pdf.Document.Save(Stream outputStream, SaveOptions options)
bei Aspose.Pdf.Document.Save(String outputFileName, SaveOptions options)

Best regards

Hi Christian,

Thanks for contacting support.

I have tested the scenario using Aspose.Pdf for .NET 10.7.0 in VS2010 application with target platform as .NET Framework 4.0 running over Windows 7 (x64) and I am unable to notice any issue. As per my observations, the PDF file is properly being converted to DOCX format when using RecognitionMode.Flow. For your reference, I have attached the resultant DOCX generated over my end.

Well, I just tried to reproduce the error in my test environment, but now I can convert to pdf without any problem, difference: with ACTIVATED license.

If the license is not set I get the OutOfMemoryException.

So, in this case I am unable to reproduce the original problem, because I am almost 100% sure that I had the issue with activated license.

Hi Christian,

Thanks for your feedback. Yes you are correct currently the exception will be raised if license is not set or it is expired. Please double check license implementation/validity in your production environment.

Moreover, I have logged a ticket PDFNEWNET-39363 in our issue tracking system for correction, API should Evaluation/Expiry Exception instead OutOfMemmoryException. We will notify you as soon as it is resolved.

Best Regards,