We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Can't open storage on LockBytes.

Hi,

I am trying to convert word binary data to PDF binary data , but Unable to convert.

It is giving an error "Can't open storage on LockBytes." at    Dim pdfDoc As PdfDocument = converter.ConvertToPDF(stream)


                                Dim stream As Stream = New MemoryStream(buffer)
                                Dim converter As New DocToPDFConverter()
                                Dim pdfDoc As PdfDocument = converter.ConvertToPDF(stream)   ' Getting an error here
                                Dim stream2 As MemoryStream = New MemoryStream()
                                pdfDoc.Save(stream2)
                                fileContent = stream2.ToArray()


Please help to solve this.

Thank you.

3 Replies

NB Nithya B Syncfusion Team August 5, 2014 12:46 PM UTC

Hi Narsa,

Thank you for using Syncfusion products.

We are not able to reproduce the mentioned "Can't open storage on LockBytes" exception issue on our side while converting word document stream data into PDF. We have attached sample which we have used to reproduce the mentioned exception issue on our end. Please do find the sample from the attachment. Try running the sample and let us know if this helps you.

 

If still you are able to reproduce this issue, kindly revert back us with the sample along with the template document which you have used to reproduce the issue on your end and it would be more helpful for us to analyze further on this issue.

 

Please let us know if you have any other questions.

 

Regards,

Nithya


Attachment: Syncfusion_VB_Sample_cef59b3a.zip


NA Narsa August 6, 2014 09:03 AM UTC

Dear Nithya,

I have found problem with the document and document format is "doc"
 please download the document here Click here to download  and replace with "DoctoPDF.docx"  in your sample project .   

I cannot modify / resave the file with new format like 'docx' , beacause it is already exported to Sql server with image data type.

Thank you.




NB Nithya B Syncfusion Team August 7, 2014 09:05 AM UTC

Hi Narsa,

 

On analyzing further on the attached document, we noticed that the document is MS Word pre - 97 format (File is created using older version of MS Word previous to 97 version). Currently DocIO doesn’t have support to preserve preformatted MS Word files. As a workaround kindly resave the document using any later version of MS Word and open that document using DocIO. For your reference we have attached the modified document which is resaved by MS Word. Please do find the modified document from attachment.

 

Please do find the compatibility with MS Word supported by DocIO from below link.

http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/prerequisitesandcomp4.htm

 

Still we are able to reproduce image alignment issue in Doc to PDF conversion. We have forwarded this to our developer for further analysis.

 

As per our forum regulation, we will not be able to share the fix for the issue through forum. However, if you are interested in receiving this fix then, we would request you to use our Direct-Trac Support system to get the fix for this issue and resolve all your technical queries. For more details, please login into http://www.syncfusion.com/Account/ and we will be happy to help you.

 

Please let us know in case of any queries.

 

Regards,

Nithya


Attachment: Syncfusion_SampleDocument_3d459b2a.zip

Loader.
Live Chat Icon For mobile
Up arrow icon