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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DocToPDFConverter error "Was unable to read sufficient bytes from the stream"

Thread ID:

Created:

Updated:

Platform:

Replies:

121926 Feb 9,2016 01:03 PM UTC Feb 18,2016 10:19 AM UTC WPF 8
loading
Tags: DocIO
andrea fanara
Asked On February 9, 2016 01:03 PM UTC

Hi, we have a problem on conversion from doc to pdf. Using the function "ConvertToPdf" for converting doc's file, we obtain this error "Was unable to read sufficient bytes from the stream". In particular the file is formed by 369KB.

Have you an idea how we can resolve this problem?

Below we put the part of code we use:

foreach(StringsAllegatoinoAllegatiWord)

{

Syncfusion.DocToPDFConverter.DocToPDFConverterDocConverter =newSyncfusion.DocToPDFConverter.DocToPDFConverter();

PdfDocumentoAllegatoPdf = DocConverter.ConvertToPDF(sAllegato);

oAllegatoPdf.Save(sAllegato.Replace(".doc",".pdf"));

oAllegatoPdf.Close();

oAllegatiPDF.Add(sAllegato.Replace(".doc",".pdf"));

}

Thanks in advance,

best regards

Andrea


Suganya Rathinam [Syncfusion]
Replied On February 10, 2016 06:03 AM UTC

Hi Andrea,

Thank you for contacting Syncfusion support.

We are not able to reproduce the mentioned exception issue while converting the Word document to PDF using DocIO. Kindly provide us the following details to reproduce the issue at our end so that we can analyze further and update you with the appropriate solution at the earliest.

1. Input Word document used.
2. Working scenario along with the sample or complete code snippet used.

Please let us know if you have any questions.

Regards,
Suganya


andrea fanara
Replied On February 10, 2016 07:44 AM UTC

We have attached the file that we use; the code is put below and we have errors expection on
DocConverter.ConvertToPDF's function.

foreach(Strings Allegato in oAllegatiWord)

{

Syncfusion.DocToPDFConverter.DocToPDFConverterDocConverter =newSyncfusion.DocToPDFConverter.DocToPDFConverter();

PdfDocumentoAllegatoPdf = DocConverter.ConvertToPDF(sAllegato);

oAllegatoPdf.Save(sAllegato.Replace(".doc",".pdf"));

oAllegatoPdf.Close();

oAllegatiPDF.Add(sAllegato.Replace(".doc",".pdf"));

}



Thanks in advance,

best regards.

Andrea





Attachment: PATRITO_PIEROCKL_VEN_00420160009PATRITO_PIEROTavolo_Preventivo_9_2016__Allegato_N°_1_4a952e0b.rar

andrea fanara
Replied On February 10, 2016 07:47 AM UTC

p.s. the file when is read is obviously unzipped (.doc)

Suganya Rathinam [Syncfusion]
Replied On February 11, 2016 09:52 AM UTC

Hi Andrea,

Thank you for your update.

We have analyzed the given input Word document and found that some information regarding the image is lost in file level, causes the exception issue while opening the Word document using DocIO. This issue has been resolved while resaving the document using MSWord and used the resaved document to convert it to PDF document. As a work around kindly use the document resaved by MS Word. Please find the resaved document from the below link.

http://www.syncfusion.com/downloads/support/forum/121926/ze/ModifiedDocument1736582614.zip

We will consider to fix this exception issue in any of our upcoming releases.

Regards,
Suganya


andrea fanara
Replied On February 15, 2016 11:17 AM UTC

Thank you Suganya,
we are waiting the next release!

Andrea

Suganya Rathinam [Syncfusion]
Replied On February 16, 2016 06:05 AM UTC

Hi Andrea,

The fix for the mentioned exception issue will be available in our upcoming release.

Regards,
Suganya


andrea fanara
Replied On February 17, 2016 04:01 PM UTC

p.s. For your information if we save the document with ms word 2007 we get the problem, but if we save the same document with ms word 2010 we obtain what we want.

Andrea

Ayswarya Krishna Kumar [Syncfusion]
Replied On February 18, 2016 10:19 AM UTC

Hi Andrea,
Thank you for your update.
For further analyzing, we resaved the document which you have attached in your update on February 10th, 2016 (PATRITO_PIERO-CKL_VEN_004-2016-0009-PATRITO_PIERO-Tavolo_Preventivo_9_2016_-_Allegato_N°_1.doc) with Microsoft Word 2007 and converted the resaved document to PDF. We are unable to reproduce the exception.
Could you please provide us the input document that you used to reproduce the issue at your end? So that we could provide you appropriate details on this.
Please let us know if you have any other questions.
Regards,
Ayswarya

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;