OpenXML: Anyway, if the Word document is suitable for one page

So far, I doubt if I open the document using OpenXML sdk in C # and add some information, is there a way to see if it all fits on one page?

If this is not the case, I will not reduce the font size on certain elements that I added until it fits.

I could write this algorithm if I had the current size relative to the size of the page with margins and all that.

+4
source share
1 answer

I looked at this example on another site, I don’t know if it will work in your case, since it requires Office PIA ...

var app = new Word.Application(); var doc = app.Documents.Open("path/to/file"); doc.Repaginate() var pageNumber = doc.BuiltInDocumentProperties("Number of Pages").Value as int; 
+1
source

All Articles