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

后端 未结 1 1978
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 23:07

I have a bunch of data that I need to export from a website to a PowerPoint presentation and have been using Open XML SDK 2.0 to perform this task. I have a PowerPoint pres

相关标签:
1条回答
  • 2020-12-09 23:43

    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/

    0 讨论(0)
提交回复
热议问题