Free Support Forum - aspose.com

EndOfStreamException: Unable to read beyond the end of the stream

Hi. I am using Aspose.Words to convert word documents to pdf. I have a word document that contains content that was copied from a web page. When I try to save it as pdf, it gives me this error:

EndOfStreamException: Unable to read beyond the end of the stream.

I must do this conversion using Aspose, I cannot simply use the latest version of word to export to PDF.

I discovered this in aspose.words 8, and attempted it with a trial version of 10.2.0.0, and get the same error in both cases.

Can you please tell me how to resolve this? I am attaching a word document that gives this behavior.

<!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Malgun Gothic"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-ansi-language:EN-SG; mso-fareast-language:ZH-CN;}

<![endif]–>

Hello

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

Hi,

I am having a similar issue. When I try to convert html to word via creating a documentbuilder and using the inserthtml method, it gives me the same exception. The strange part is that it only occurs on certain computers. Could you tell us the underlying cause of the exception? This is the stack trace:

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>ZH-CN</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:SimSun; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–><span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;color:#555555;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>:
Critical : Unable to read beyond the end of the stream.

at System.IO.__Error.EndOfFile()

at System.IO.BinaryReader.FillBuffer(Int32 numBytes)

at System.IO.BinaryReader.ReadInt32()

at x6c95d9cf46ff5f25.xa8866d7566da0aa2.x95ea7d23cc8ee04d()

at xc23bef7190ca8f55.x6412d0c71c34c05c.x796bceaf1a71d638()

at xc23bef7190ca8f55.x6412d0c71c34c05c.xc5539ef56f278c00()

at xc23bef7190ca8f55.x6412d0c71c34c05c.xecc762181249f892(String
xafe2f3653ee64ebc)

at xc23bef7190ca8f55.x6412d0c71c34c05c.x99a36cf35453249e(String
x4fd966aaf32161e8)

at xc23bef7190ca8f55.x6412d0c71c34c05c.get_x99f0e2a5ac5ce2db()

at xc23bef7190ca8f55.x6412d0c71c34c05c.x7c720c8bae578197(String
xa79a9f649c74f4a4)

at xc23bef7190ca8f55.x6412d0c71c34c05c.xdc2247c8d4648ae8(String
xa79a9f649c74f4a4, FontStyle x44ecfea61c937b8e)

at xc23bef7190ca8f55.x6412d0c71c34c05c.x9059a3203c8fc855(String
xa79a9f649c74f4a4, FontStyle x44ecfea61c937b8e, String x050683ee5a5f962b)

at x5794c252ba25e723.xe39d06eee35dd23d…ctor(String familyName,
Single sizePoints, FontStyle style, String altFamilyName)

at x5794c252ba25e723.xe39d06eee35dd23d.x9059a3203c8fc855(String
xa79a9f649c74f4a4, Single xdb421875a5f5258b, Boolean xb0c2ce71ea178326, Boolean
xeac181883dccb27a)

at xde385359626e77eb.xa4369c8993e5e35e.xaee1c0588639d742(String
xb41faee6912a2313, Font x26094932cf7a9139)

at xde385359626e77eb.xa4369c8993e5e35e.x078636a93569b1b4(Run
xb0e5d73738e62f9e, Int32 xd4f974c06ffa392b, Int32 x961016a387451f05)

at xde385359626e77eb.xa4369c8993e5e35e.xbd177059d4974325(Run
xb0e5d73738e62f9e, x66ed6507f98b1be8 x30fdecd22136d9de)

at xde385359626e77eb.xa4369c8993e5e35e.x7d880ef92b7e4841(Paragraph
x31e6518f5e08db6c)

at xde385359626e77eb.xdce5f72473519d4e.xb6f3586d2f1ff486(Cell
xe6de5e5fa2d44af5)

at xde385359626e77eb.xdce5f72473519d4e.xd7db49f79aa576a2(Cell
xe6de5e5fa2d44af5, x4c38e800e85b21ad xe3e287548b3d01f5)

at xde385359626e77eb.xdce5f72473519d4e.xceba8ebf9e82a25a()

at xde385359626e77eb.xdce5f72473519d4e.xb7fad3d41ea414e7()

at xde385359626e77eb.xdce5f72473519d4e.xadbaf0fef5a4f7fb()

at
x9b5b1a17490bd5f3.xbcfc3a3bbf12a494.x5b7cc3ed4565d299(x9d6b37cac59aa2e2
xda5bf54deb817e37, Boolean x4e90add18a439932)

at x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.x4b9eb3fda3482750(x9d6b37cac59aa2e2
xda5bf54deb817e37, Boolean xa59013d234619c58)

at
x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.x501416f35422f0c6(x9d6b37cac59aa2e2
xda5bf54deb817e37, Boolean xa59013d234619c58)

at x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.xd01fc8d304d05d80(x9d6b37cac59aa2e2
xda5bf54deb817e37, Boolean xa59013d234619c58)

at
x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.xca9ad4a20a9617e7(x9d6b37cac59aa2e2
xda5bf54deb817e37)

at
x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.xca9ad4a20a9617e7(x9d6b37cac59aa2e2
xda5bf54deb817e37)

at
x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.xca9ad4a20a9617e7(x9d6b37cac59aa2e2
xda5bf54deb817e37)

at
x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.xe7b44b122fc48755(x9d6b37cac59aa2e2
xda5bf54deb817e37)

at x9b5b1a17490bd5f3.xc5f6f2ca0aafd220.x06b0e25aa6ad68a9(String
x27d6d3ff1b275a1a, DocumentBuilder xd07ce4b74c5774a7)

at Aspose.Words.DocumentBuilder.InsertHtml(String html)

This occurs for any html.

Using Aspose.Words 9.3.0.0

Thanks.

Hi

Thanks for your request. The issue reported in this thread is already resolved in the current codebase. The fix will be included into the next version of Aspose.Words that comes out in a week.

Could you please attach the document that causes the problem on your side? I will check it and provide you more information.

Also, have you tried using the latest version of Aspose.Words? You can download it from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards,

The issues you have found earlier (filed as WORDSNET-4996) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.