How to split table to new PowerPoint slide when content flows off current slide using Open XML SDK 2.0

ぃ、小莉子 提交于 2019-11-28 10:25:40

This is a really great question. One thing you can do is measure the height and width of the fonts in System.Drawing.Text and create a sort of pre-renderer in code to figure out if the text will cause the table to flow off-screen. There would be a bit to keep track of, like at what width will the fonts wrap and create a new line and then space between the lines and the margin of the cells. It would be a running total to keep track of the table height by the total number of lines it could contain with your font and it's size and your text plugged-in - and still stay within the bounds of the slide canvas. But once you have all of this, it should give you very good insight into whether or not you need a new slide.

This is a good article to learn how to measure rendered text in .NET: http://www.devsource.com/c/a/Languages/Text-Metrics-in-the-Net-Framework-Part-I/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!