theone69 Posted August 10, 2006 Posted August 10, 2006 Hello everybody! I have a problem with which I've been struggling for the last couple of days. We have a web site with a lot of articles and have recently prepared a functionality for automatic conversion of the text to PDF. The conversion works fine, but there is a problem - the thing is that we should be able to control the page flow so that there wouldn't be any unwanted page breaks - that is because certain pieces of the content (eg. tables) should not break. Our idea is to calculate the remaining height on the page and comparing it to the needed height. If the needed space is bigger than the space available we would insert manual page break. Yet, as you may imagine we have problems how to determine text height. I have some experience with VB 6 where Printer.TextHeight method could be used, but don't know how to implement this type of functionality in ASP.NET (2.0). I have read about Graphics.DrawString method, but lack the experience to make it work. Any ideas and suggestions on the subject would be most welcome. Or, a different solution maybe? Thanks, Bostjan Quote
Administrators PlausiblyDamp Posted August 10, 2006 Administrators Posted August 10, 2006 Graphics.MeasureString should be able to tell you what you need. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.