Odd error - Text can not be read on an overflow FormattedTextArea

Odd error - Text can not be read on an overflow FormattedTextArea

Forum member · Aug 28, 2008
Hello, I am using the following code to generate a lookup index in the following format: Maltodextrin 5mg............10 PROSTIGMIN 15mg tab.........22 VIVACTIL....................23 The code allows me to create multiline (overflow) index items such as: nitroglycerine cap sa; tab, sl; 0.1mg/hr, 0.2mg/hr, 0.6mg/hr adh. patch.........64 It works fine when I use a TextArea object, but when I use a FormattedTextArea object I recieve a "Text can not be read on an overflow FormattedTextArea" error on the line shown below: // First lets get all of the text needed to populate the first line, second, to n-1 lines // The Nth line will hold the dots FormattedTextArea ftaIndexItem = null; if (System.Convert.ToBoolean(dataRow["IsGeneric"])) { ftaIndexItem = new FormattedTextArea("<i>" + dataRow["ItemDescription"].ToString() + "</i>", 0, 0, (col1Width - 10f), FORMULARYFONTSIZE, m_verdanaFontFamily, FORMULARYFONTSIZE, false); } else { ftaIndexItem = new FormattedTextArea(dataRow["ItemDescription"].ToString(), 0, 0, (col1Width - 10f), FORMULARYFONTSIZE, m_verdanaFontFamily, FORMULARYFONTSIZE, false); } Group indexItemGroup = new Group(); // Create ProviderDirectory_DottedLabelComposite instance ProviderDirectory_DottedLabelComposite dottedLabel; // Create row instance Row ceteRow; ceteRow = pdfTable.Rows.Add(ftaIndexItem.GetRequiredHeight() + 1.5f); do { if (ftaIndexItem.HasOverflowText()) { indexItemGroup.Add(ftaIndexItem); ftaIndexItem = ftaIndexItem.GetOverflowFormattedTextArea(0, (ftaIndexItem.Y + 12.5f), (col1Width - 10f)); } else { ***************** ERROR HAPPENS ON THIS "dottedLabel at ftaIndexItem.Text" ***************** dottedLabel = new ProviderDirectory_DottedLabelComposite(ftaIndexItem.Text, dataRow["ItemPageNumber"].ToString(), 0, ftaIndexItem.Y, FORMULARYFONTSIZE, m_ttfVerdana, (col1Width + col2Width - 7f)); indexItemGroup.Add(dottedLabel); ftaIndexItem = null; } } while (ftaIndexItem != null);

Re: Odd error - Text can not be read on an overflow FormattedTextArea

Forum member · Aug 28, 2008
Forgot to say this at the end of my message, Thank you for your time! Matt L.

Re: Odd error - Text can not be read on an overflow FormattedTextArea

Forum member · Aug 28, 2008
I found this in the Java documentation, but why is this? http://www.DynamicPDF.com/Support/Java_API_Reference_06_06/com/cete/dynamicpdf/pageelements/FormattedTextArea.html#getText()

Re: Odd error - Text can not be read on an overflow FormattedTextArea

Forum member · Aug 28, 2008
I have fixed the issue. My solution required the entire line to be either italicized or regular. I set the font to use for the TextArea using the following: if (System.Convert.ToBoolean(dataRow["IsGeneric"])) { font = FontFamily.Helvetica.Italic; } else { font = FontFamily.Helvetica.Regular; } Sorry to waste your time! Matt L.