Hi Filip,
Sorry for the delay in getting back to you.
This seems to be a bug so I have filed a bug report with the development team. You can track the status of this issue here
http://www.syncfusion.com/support/issues/pdf/Default.aspx?ToDo=view&questId=443
For now you would have to manually measure the height using the MeasureHeightInLines method of the graphics class.
Thank you for your patience.
Best regards,
Stephen.
>Forget about my previous post!
>That problem with the index out of range is solved. Bad coding by me :-)
>
>BUT... there is still one minor problem.
>let''s say my page has a height of 600 (pixels or point or whatever) and i have reached 500...
>the next string i''m about to print is 12 lines with each line 10 in height (which means 120 points)...
>
>now, what i would expect is that DrawMultiText fills my page untill the bottom and then makes a new page and puts the rest (last 2 lines) on the next page.
>
>But it does not do that... it leaves the last 100 points of my current page blank and creates a new page and starts printing my text on the newly created page.
>(even if i do this:)
>
>IPDFPage PdfPage;
>PdfPage = this.m_pdfDoc.Pages[m_intCurrentPage];
>
>PdfPage.Graphics.DrawMultiText(new Rectangle(p_Point.X,p_Point.Y,(int)PdfPage.DrawingWidth,m_intHoogte),p_strText,this.m_labelHeaderProps.TP_Font,this.m_labelHeaderProps.TP_Props);
>
>my question:
>Is there a way of filling up my current page completely before DrawMultiText creates that new page and then print the rest of the text on that new page?
>Or will i have to find a way to split up my string at line 10 and do it myself? :-)
>
>thanks for your time and help!
>
>greetings,
>
>Filip
>>Thank you for the quick response!
>>
>>But i still have a problem.
>>My document consists out of text and images,
>>which alternates. So i can start at page 1 with a string that makes the title, then an image under that title, then another string with a description (consisting out of 1 or more lines), another string with a title, another image, another string with a description (consisting out of 1 or more lines) and so on...
>>so at one point i get to the bottom of my page and i have to print a description with consists out of multiple lines (maybe even 2 pages of text)
>>
>>now when i call pdfDoc.Graphics.DrawMultiText, it doesn''t have a parameter that says on what page i am and i get an IndexOutOfRangeException.
>>
>>still trying to find a way to solve this though ;)
>>but any more help would be greatly appreciated :)
>>>Hi Filip,
>>>
>>>You can make text span several pages by setting PageBreak behavior
>>> IPDFGraphicState props = pdfDoc.CreateGraphicState();
>>> props.BreakBehaviour = AutoBreakBehaviour.FullBreak;
>>>
>>>
Here is a sample
>>>
>>>Please let me know if you have any questions.
>>>
>>>Thanks,
>>>
>>>Stephen.
>>>
>>>>I have a similar problem!
>>>>
>>>>I have a procedure to create a pdf-file
>>>>which gets a string as a parameter.
>>>>Depending on the length of the string, I decide whether to use DrawText or DrawMultiText which works fine...
>>>>the only problem I get is when I get a string
>>>>consisting out of multiple lines that has more
>>>>lines than there is place left on the page I''m
>>>>drawing on... is there a way to make the text go further on the next page or perhaps a way to split my string into two parts based on the number of lines so that I can put the first part on the end of the first page and the second part on the second page?
>>>>I hope I explained this properly and that I will find help here! :)
>>>>
>>>>thanks anyway!
>>>>