| { | { | ||||
| float f; | float f; | ||||
| if (float.TryParse(top.Value, out f)) | if (float.TryParse(top.Value, out f)) | ||||
| return (int)(f / 15.0f); | |||||
| return (int)(f / 20.0f); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| XAttribute top = pgMar.Attribute(xName); | XAttribute top = pgMar.Attribute(xName); | ||||
| if (top != null) | if (top != null) | ||||
| { | { | ||||
| top.SetValue(value * 15); | |||||
| top.SetValue(value * 20); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| public float MarginTop | |||||
| /// <summary> | |||||
| /// Top margin value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float MarginTop | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| } | } | ||||
| } | } | ||||
| public float MarginBottom | |||||
| /// <summary> | |||||
| /// Bottom margin value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float MarginBottom | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| } | } | ||||
| } | } | ||||
| public float MarginLeft | |||||
| /// <summary> | |||||
| /// Left margin value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float MarginLeft | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| } | } | ||||
| } | } | ||||
| public float MarginRight | |||||
| /// <summary> | |||||
| /// Right margin value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float MarginRight | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| } | } | ||||
| } | } | ||||
| public float PageWidth | |||||
| /// <summary> | |||||
| /// Page width value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float PageWidth | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| { | { | ||||
| float f; | float f; | ||||
| if (float.TryParse(w.Value, out f)) | if (float.TryParse(w.Value, out f)) | ||||
| return (int)(f / 15.0f); | |||||
| return (int)(f / 20.0f); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return (int)(11906.0f / 15.0f); | |||||
| return (12240.0f / 20.0f); | |||||
| } | } | ||||
| set | set | ||||
| if (pgSz != null) | if (pgSz != null) | ||||
| { | { | ||||
| pgSz.SetAttributeValue(XName.Get("w", DocX.w.NamespaceName), value * 15); | |||||
| pgSz.SetAttributeValue(XName.Get("w", DocX.w.NamespaceName), value * 20); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| public float PageHeight | |||||
| /// <summary> | |||||
| /// Page height value in points. 1pt = 1/72 of an inch. Word internally writes docx using units = 1/20th of a point. | |||||
| /// </summary> | |||||
| public float PageHeight | |||||
| { | { | ||||
| get | get | ||||
| { | { | ||||
| { | { | ||||
| float f; | float f; | ||||
| if (float.TryParse(w.Value, out f)) | if (float.TryParse(w.Value, out f)) | ||||
| return (int)(f / 15.0f); | |||||
| return (int)(f / 20.0f); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return (int)(16838.0f / 15.0f); | |||||
| return (15840.0f / 20.0f); | |||||
| } | } | ||||
| set | set | ||||
| if (pgSz != null) | if (pgSz != null) | ||||
| { | { | ||||
| pgSz.SetAttributeValue(XName.Get("h", DocX.w.NamespaceName), value * 15); | |||||
| pgSz.SetAttributeValue(XName.Get("h", DocX.w.NamespaceName), value * 20); | |||||
| } | } | ||||
| } | } | ||||
| } | } |