Example #1
0
        /// <summary>
        /// Sets the page margins to <paramref name="marginSize"/> in hundredths of an inch e.g. 20 = 0.20"
        /// </summary>
        /// <param name="document"></param>
        /// <param name="marginSize"></param>
        protected void SetMargins(XWPFDocumentFile document, int marginSize)
        {
            document.Document.body.sectPr             = document.Document.body.sectPr ?? new CT_SectPr();
            document.Document.body.sectPr.pgMar.right = (ulong)(marginSize * 14.60);
            document.Document.body.sectPr.pgMar.left  = (ulong)(marginSize * 14.60);

            /*document.MarginLeft = marginSize;
             * document.MarginRight= marginSize;
             * document.MarginTop = marginSize;
             * document.MarginBottom = marginSize;*/
        }
Example #2
0
        protected void SetLandscape(XWPFDocumentFile document)
        {
            document.Document.body.sectPr      = document.Document.body.sectPr ?? new CT_SectPr();
            document.Document.body.sectPr.pgSz = document.Document.body.sectPr.pgSz ?? new CT_PageSz();

            document.Document.body.sectPr.pgSz.orient = ST_PageOrientation.landscape;
            document.Document.body.sectPr.pgSz.w      = (842 * 20);
            document.Document.body.sectPr.pgSz.h      = (595 * 20);


            //document.PageLayout.Orientation = Orientation.Landscape;
        }
Example #3
0
 protected float GetPageWidth(XWPFDocumentFile document)
 {
     return(500);
     //return document.PageWidth;
 }
Example #4
0
 protected void InsertTableOfContents(XWPFDocumentFile document)
 {
     //todo
     //document.InsertTableOfContents("Contents", new TableOfContentsSwitches());
 }
Example #5
0
 /// <summary>
 /// Opens windows explorer to show the document
 /// </summary>
 /// <param name="document"></param>
 protected void ShowFile(XWPFDocumentFile document)
 {
     ShowFile(document.FileInfo);
 }