Free Support Forum - aspose.com

Invalid size of text box in ShowBoxed method

I’m getting the mentioned error ONLY when I test my PDF generation with 10 concurrent web users. I’m using .Net 1.1, IIS 5.1, and Visual Studio 2003 version 7.1.3088. When I was including images, I would get image area too big. Since these are sporatic errors and never appear to occur in exactly the same place, I believe they are concurrency issues. Attached is my studio project. I used Microsoft application test center to simulate 10 concurrent users accessing the PDF by pushing the PDF button on WebForm1. The demo.zip contains the versions of the Aspose controls I’m using.

Thanks
Sean Fuller

Additionally, here is a stack trace from one of the exceptions:

[ArgumentException: Invalid size of text box in ShowBoxed method.]
Aspose.Pdf.PdfText.z.a(aa A_0, String A_1, Single A_2, Single A_3, Single A_4, Single A_5, String A_6, Boolean A_7, Single A_8, Int32 A_9) +3935
Aspose.Pdf.PdfText.aa.a(String A_0, Single A_1, Single A_2, Single A_3, Single A_4, String A_5, Boolean A_6, Single A_7, Int32 A_8) +34
Aspose.Pdf.Xml.w.a(a A_0, Pdf A_1, Text A_2, Int32 A_3) +1005
Aspose.Pdf.Xml.b.a(a A_0, Pdf A_1, Text A_2, Int32 A_3) +2735
Aspose.Pdf.Xml.az.a(a A_0, Pdf A_1, c A_2, Boolean A_3) +4396
Aspose.Pdf.Xml.n.a(a A_0, Pdf A_1) +592
Aspose.Pdf.Xml.ad.a(a A_0, Pdf A_1) +211
Aspose.Pdf.Pdf.Save(String fileName, SaveType saveType, HttpResponse response) +131
WebApplication1.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication1\webform1.aspx.cs:76

Dear sfuller3,

Thank you for considering Aspose.

Aspose.Pdf has some problems when running in multi-thread. Checking this iuuse and modifying my code needs much time so I have to do this work later.

After doing some further testing, I’ve found that by saving output to a stream rather than having the control save the info directly to the System.Web.HttpResponse object I’ve reduced the number of errors from 5% of all requests down to 1.5% of all requests.

OLD CODE:
pdf.Save(“file.pdf”,SaveType.OpenInBrowser,Response);
NEW CODE:
pdf.Save(output);
Where output is the output stream from the Response object.

Maybe This will give you some direction where to look to fix the concurrency issues.