Example #1
0
        /**
         * Set a RtfHeaderFooter to be displayed at a certain position
         *
         * @param headerFooter The RtfHeaderFooter to display
         * @param displayAt The display location to use
         */
        public void SetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
        {
            this.mode = MODE_MULTIPLE;
            headerFooter.SetRtfDocument(this.document);
            headerFooter.SetType(this.type);
            headerFooter.SetDisplayAt(displayAt);
            switch (displayAt)
            {
            case RtfHeaderFooter.DISPLAY_ALL_PAGES:
                headerAll = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
                headerFirst = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
                headerLeft = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
                headerRight = headerFooter;
                break;
            }
        }
Example #2
0
 /**
  * Constructs a RtfHeaderGroup for a certain HeaderFooter
  *
  * @param doc The RtfDocument this RtfHeaderFooter belongs to
  * @param headerFooter The HeaderFooter to display
  * @param type The typ of RtfHeaderFooterGroup to create
  */
 public RtfHeaderFooterGroup(RtfDocument doc, Legacy.Text.HeaderFooter headerFooter, int type) : base(new Phrase(""), false)
 {
     this.document = doc;
     this.type     = type;
     this.mode     = MODE_SINGLE;
     headerAll     = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
     headerAll.SetType(this.type);
 }
Example #3
0
 /**
  * Set that this RtfHeaderFooterGroup should have a title page. If only
  * a header / footer for all pages exists, then it will be copied to the
  * first page aswell.
  */
 public void SetHasTitlePage()
 {
     if (this.mode == MODE_SINGLE)
     {
         this.mode   = MODE_MULTIPLE;
         headerFirst = new RtfHeaderFooter(this.document, headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
         headerFirst.SetType(this.type);
     }
 }
Example #4
0
 /**
  * Set the type of this RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER
  * or RtfHeaderFooter.TYPE_FOOTER. Also sets the type for all RtfHeaderFooters
  * of this RtfHeaderFooterGroup.
  *
  * @param type The type to use
  */
 public void SetType(int type)
 {
     this.type = type;
     if (headerAll != null)
     {
         headerAll.SetType(this.type);
     }
     if (headerFirst != null)
     {
         headerFirst.SetType(this.type);
     }
     if (headerLeft != null)
     {
         headerLeft.SetType(this.type);
     }
     if (headerRight != null)
     {
         headerRight.SetType(this.type);
     }
 }
 /**
 * Set a RtfHeaderFooter to be displayed at a certain position
 *
 * @param headerFooter The RtfHeaderFooter to display
 * @param displayAt The display location to use
 */
 public void SetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
 {
     this.mode = MODE_MULTIPLE;
     headerFooter.SetRtfDocument(this.document);
     headerFooter.SetType(this.type);
     headerFooter.SetDisplayAt(displayAt);
     switch (displayAt) {
         case RtfHeaderFooter.DISPLAY_ALL_PAGES:
             headerAll = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
             headerFirst = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
             headerLeft = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
             headerRight = headerFooter;
             break;
     }
 }
 /**
 * Set that this RtfHeaderFooterGroup should have a title page. If only
 * a header / footer for all pages exists, then it will be copied to the
 * first page aswell.
 */
 public void SetHasTitlePage()
 {
     if (this.mode == MODE_SINGLE) {
         this.mode = MODE_MULTIPLE;
         headerFirst = new RtfHeaderFooter(this.document, headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
         headerFirst.SetType(this.type);
     }
 }
 /**
 * Constructs a RtfHeaderGroup for a certain HeaderFooter
 *
 * @param doc The RtfDocument this RtfHeaderFooter belongs to
 * @param headerFooter The HeaderFooter to display
 * @param type The typ of RtfHeaderFooterGroup to create
 */
 public RtfHeaderFooterGroup(RtfDocument doc, Legacy.Text.HeaderFooter headerFooter, int type)
     : base(new Phrase(""), false)
 {
     this.document = doc;
     this.type = type;
     this.mode = MODE_SINGLE;
     headerAll = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
     headerAll.SetType(this.type);
 }