Overflow error.

Technical support for Spire.Doc

Moderator: iceblue support

Overflow error.

Postby brubru » Mon Dec 13, 2010 4:24 pm

Hi guys..
thanks for your answers!!
Now I got "Overflow error." when it tries to save the image.
this my code:

var document = new Document();
document.LoadFromFile(tempFileName, FileFormat.Rtf);
document.Sections[0].PageSetup.Margins.Top = 0f;
document.Sections[0].PageSetup.Margins.Bottom = 0f;
document.Sections[0].PageSetup.Margins.Left = 0f;
document.Sections[0].PageSetup.Margins.Right = 0f;

var rtfImage = (Bitmap)document.SaveToImages(0, ImageType.Bitmap);

this is the file RTF content:

"{\rtf1\ansi\deff0

{\fonttbl
{\f0 Arial;}
}

{\colortbl
;
}

\deflang1033\plain\fs20\widowctrl\hyphauto\ftnbj
\paperw11906\paperh16838
\margt1440
\margr1800
\margb1440
\margl1800


{\pard\fi0
{\rtf1\ansi\ansicpg1252\uc1\deff0{\fonttbl
{\f0\fswiss\fcharset0\fprq2 Arial;}
{\f1\froman\fcharset2\fprq2 Symbol;}}
{\colortbl;\red0\green0\blue0;\red255\green255\blue255;}
{\stylesheet{\s0\itap0\f0\fs24 [Normal];}{\*\cs10\additive Default Paragraph Font;}}
{\*\generator TX_RTF32 12.0.500.502;}
\deftab1134\paperw12240\margl1190\margt500\margr500\margb250\notabind
{\*\background{\shp{\*\shpinst\shpleft0\shptop0\shpright0\shpbottom0\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr0\shpwrk0\shpfblwtxt1\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 16777215}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fBackground}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}}}\pard\itap0\qj\plain\f0\fs24 Escreva sobre tomada de decis\loch\f0\hich\f0\'e3o em equipe, abordando os aspectos positivos e poss\'edveis disfun\'e7\'f5es. Entre essas \'faltimas, explique o que \'e9 o paradoxo do consenso.\par }
\par}

}"

And this is the Exception Stack Trace:

[OverflowException: Overflow error.]
System.Drawing.Graphics.CheckErrorStatus(Int32 status) +1151008
System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) +211
System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle) +32
lm.a(String A_0, CharacterFormat A_1, ParagraphFormat A_2, RectangleF A_3, s8 A_4) +3232
lm.a(TextRange A_0, s8 A_1, String A_2) +777
Spire.Doc.Fields.TextRange.Spire.Doc.Layout.IStringWidget.Draw(lm dc, s8 ltWidget, String text) +28
Spire.Doc.Fields.TextRange.Spire.Doc.Layout.IDocumentBase.Draw(lm dc, s8 ltWidget) +80
s8.a(lm A_0) +42
s8.a(lm A_0) +202
s8.a(lm A_0) +202
s8.a(lm A_0) +202
s8.a(lm A_0) +202
tj.a(lm A_0) +90
eo.a(Int32 A_0, Int32 A_1, ImageType A_2, MemoryStream A_3) +626
Spire.Doc.Document.SaveToImages(Int32 pageIndex, ImageType type) +80


Thanks a lot,
Bruno Oliveira
brubru
 
Posts: 3
Joined: Tue Nov 30, 2010 6:11 pm

Re: Overflow error.

Postby harry.support » Tue Dec 14, 2010 9:15 am

Hi Bruno Oliveira,

Sorry for that.
It's a bug, and we have fixed it. More time is needed to test it, a hot fix version will be released tomorrow, and then we will notify you.

Thanks and Regards,
Harry
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Overflow error.

Postby harry.support » Wed Dec 15, 2010 11:30 am

Hello,

The Spire.Doc v3.6.2 has been released, please download it from http://www.e-iceblue.com/Download/downl ... -v362.html.
You just need to set the margin-left and margin-top in your code, for example:
document.Sections[0].PageSetup.Margins.Left = 0f;
document.Sections[0].PageSetup.Margins.Top = 0f;

Thanks and Regards,
Harry
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests