c# - Detect Printable Area Width in OpenXml.Wordprocessing -
i'm adding image word document using openxml.
i able tell size of image being added, , can resize if want to. want resize if it's wider current column. (in case, there 1 column perhaps change.)
is there way know how wide current column and, therefore, able ensure image fits within column? is, large images extending off page.
i've updated answer, because answer case when table columns involved, word column in question mean column or text rather column in table.
in document, should able following values:
// ... var sectionproperties = body.getfirstchild<sectionproperties>(); // pagesize contains width , height properties var pagesize = sectionproperties.getfirstchild<pagesize>(); // contains information surrounding margins var pagemargin = sectionproperties.getfirstchild<pagemargin>(); // contains information spacing between neighbouring columns of text // can useful if use page layout multiple text columns var columns = sectionproperties.getfirstchild<columns>(); var spacebetweencolumns = columns.space.value; var columnscount = columns.columncount.value;
i haven't tested this, suppose may able calculate actual width of text column using values.
Comments
Post a Comment