I am trying to create a component that utilizes both the DynamicPDF.Generator and Merger. When I attempt to Draw the PDF (DynamicPDF.Page.Draw()), I receive the exception: "Value was either too large or too small for an Int32".
See the following stack trace.
at System.Convert.ToInt32(Double value)
at System.Convert.ToInt32(Single value)
at ceTe.DynamicPDF.Text.TextLineList.GetLineCount(Int32 startLine, Single height)
at ceTe.DynamicPDF.Text.TextLineList.SetLines(Boolean setAllLines)
at ceTe.DynamicPDF.Text.TextLineList.Draw(PageWriter writer, Single x, Single y, TextAlign align, Color textColor, Boolean underline, Boolean rightToLeft)
at ceTe.DynamicPDF.PageElements.Label.DrawRotated(PageWriter writer)
at ceTe.DynamicPDF.PageElements.RotatingPageElement.Draw(PageWriter writer)
at ceTe.DynamicPDF.PageElements.Group.Draw(PageWriter writer)
at ceTe.DynamicPDF.Page.DrawAppend(PageWriter writer)
at ceTe.DynamicPDF.Merger.ImportedPage.DrawAppend(PageWriter writer)
at ceTe.DynamicPDF.Page.a(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3)
at ceTe.DynamicPDF.Page.c(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3)
at ceTe.DynamicPDF.PageList.a(DocumentWriter A_0, Int32 A_1)
at ceTe.DynamicPDF.IO.DocumentWriter.h()
at ceTe.DynamicPDF.Document.Draw(String filePath)
at CypPDFGenerator.PDFUtils.Save(String FilePath, Boolean Debug) in C:\Projects\Cypress\CypPDFGenerator\PDFUtils.vb:line 52
at CypPDFGenerator.PDFGenerator.CreateApplicationPDF() in C:\Projects\Cypress\CypPDFGenerator\PDFGenerator.vb:line 2114
at servicefirst.test.Button1_Click(Object sender, EventArgs e) in c:\Projects\Cypress\Cypress01\test\test.aspx.vb:line 33
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain()
Any ideas?
Thanks,
Alex
Value was either too large or too small for an Int32
Re: Value was either too large or too small for an Int32
Support · Nov 15, 2005Hello Alex,
I had some of the developers look into this stack trace a little deeper and it turns out that this error is actually coming up because a Font or a Leading property that is somewhere getting set to zero.
After looking at your code I did not see any use of the Leading property, so there is likely a font that is getting set to zero. Double check this and see if you can locate exactly where this is happening.
I was told by the developers that the next version of our product will actually raise an error in this case when Font or Leading are set to zero.
Thanks,
ceTe Software Support Team.
Re: Value was either too large or too small for an Int32
Forum member · Nov 15, 2005Yes... the problems was that the FontSize property of the method DynamicPDF.Merger.PDFDocument.Form.Fields("FieldName").CreateLabel() was getting set to 0.
Thanks again for your assistance.
Special thanks to Robbie!
Best regards,
Alex