Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
 /**
  * Sets the RtfDocument this RtfElement belongs to
  *
  * @param doc The RtfDocument to use
  */
 public void SetRtfDocument(RtfDocument doc)
 {
     this.document = doc;
     if (headerAll != null)
     {
         headerAll.SetRtfDocument(this.document);
     }
     if (headerFirst != null)
     {
         headerFirst.SetRtfDocument(this.document);
     }
     if (headerLeft != null)
     {
         headerLeft.SetRtfDocument(this.document);
     }
     if (headerRight != null)
     {
         headerRight.SetRtfDocument(this.document);
     }
 }