OperatorWriter Implementation?

OperatorWriter Implementation?

Forum member · Oct 27, 2006
I'm trying to roll my own text area renderer so I can adjust line height, since after searching the forums I gather DynamicPDF has no built-in control over this. TextLineList requires an OperatorWriter as its first argument to the Draw method, and I'm wondering if I have to create my own, or if there's an existing one hiding in the API somewhere? This is the general idea: string text = "A lot of text here..."; TextArea textArea = new TextArea(text, x, y, w, h); TextLineList lineList = LineBreaker.Latin.GetLines(text.ToCharArray(), w, h, font, size); float lineHeight = 10f; float drawY = y; bool underline = false; bool rightToLeft = false; for (int i = 0; i < lineList.Count; i++) { OperatorWriter writer = ???; lineList.Draw(writer, x, drawY, TextAlign.Left, color, underline, i, 1, rightToLeft); drawY += lineHeight; } Any help appreciated!

Re: OperatorWriter Implementation?

Support · Oct 27, 2006
Hello, In order to adjust the line height you can use the Leading property of the TextArea object to adjust the spacing between lines. In order to create CustomPageElement, you can use the Draw method of the PageWriter object instead of OperatorWriter object because the PageWriter object inherits from the OperatorWriter object. Thanks, ceTe Software Support Team

Re: OperatorWriter Implementation?

Forum member · Oct 27, 2006
This works great for TextArea, thank you! Is there any equivalent for FormattedTextArea? FormattedTextArea.Style.Line.Leading does not appear to have any effect.

Re: OperatorWriter Implementation?

Support · Oct 27, 2006
Hello, You can specify the leading for the FormattedTextArea page element using the <Line> tag's Leading attribute. Following is the syntax: <Line Leading=14 LeadingType=exactly> Thanks, ceTe Software Support Team

Re: OperatorWriter Implementation?

Forum member · Oct 27, 2006
Works like a charm, thanks again!