Class PD4PageMark

    • Constructor Detail

      • PD4PageMark

        public PD4PageMark()
    • Method Detail

      • setWatermark

        public void setWatermark​(String url,
                                 Rectangle bounds,
                                 int opacity)
        specifies watermark image to be printed on every page. Available only in Pro version of PD4ML.
        Parameters:
        url - image location
        bounds - image position and size in typographical points
        opacity - image opacity in range from 0 to 100
      • getInitialPageNumber

        public int getInitialPageNumber()
        returns initial value for the PDF document page counter.
        Returns:
        initial value
        See Also:
        setInitialPageNumber(int)
      • getPageNumberTemplate

        public String getPageNumberTemplate()
        returns string template used to print page numbers
        Returns:
        template string
        See Also:
        setPageNumberTemplate(String)
      • getPageNumberTemplate

        public String getPageNumberTemplate​(int pageNumber)
        returns string template used to print page numbers. The method can be overridden in order to add page dependent template specification
        Parameters:
        pageNumber - destination page number
        Returns:
        template string
      • getPagesToSkip

        public int getPagesToSkip()
        returns number of pages that should not be marked with header or footer area
        Returns:
        number of pages
        See Also:
        setPagesToSkip(int)
      • getTitleAlignment

        public int getTitleAlignment()
        returns title alignment value
        Returns:
        alignment
        See Also:
        setTitleAlignment(int)
      • getTitleTemplate

        public String getTitleTemplate()
        returns string template used to print document title in header or footer area
        Returns:
        template string
        See Also:
        setTitleTemplate(String)
      • getTitleTemplate

        public String getTitleTemplate​(int pageNumber)
        returns string template used to print document title in header or footer area The method can be overridden in order to add page dependent template specification
        Parameters:
        pageNumber - destination page number
        Returns:
        template string
      • getHtmlTemplate

        public String getHtmlTemplate​(int pageNumber)
        returns string template used to print HTML header or footer The method can be overridden in order to add page dependent template specification
        Parameters:
        pageNumber - destination page number
        Returns:
        template string
      • setInitialPageNumber

        public void setInitialPageNumber​(int i)
        defines initial value for the PDF document page counter. Default is 1.
        Parameters:
        i - initial page number
      • setPageNumberTemplate

        public void setPageNumberTemplate​(String string)
        defines a template for page number representation
        No page numbering is printed, if the pageNumberTemplate is set to null.
        Default value is null.
        If HTML template specified, than the method call is ignored.
        Parameters:
        string - a string with static text or/and special markups: ${page} - for current page number, ${total} - for total number of pages in the document. The both numeric values can be affected by setInitailPageNumber()
        See Also:
        setHtmlTemplate(String)
      • setPagesToSkip

        public void setPagesToSkip​(int i)
                            throws InvalidParameterException
        defines a number of pages from the document beginning, that should not be marked with the header or footer info.
        Parameters:
        i - number of pages to skip
        Throws:
        InvalidParameterException
      • setTitleTemplate

        public void setTitleTemplate​(String string)
        defines a template for page title representation.
        No title is printed, if the titleTemplate is set to null. Default value is null.
        If HTML template specified, than the method call is ignored.
        Parameters:
        string - a string with static text or/and special markups: ${title} - page title, ${page} - current page number, ${total} - for total number of pages in the document. The both numeric values can be affected by setInitailPageNumber() call
        See Also:
        setHtmlTemplate(String)
      • getAreaHeight

        public int getAreaHeight()
        returns header or footer height.
        Returns:
        header/footer area height
      • setAreaHeight

        public void setAreaHeight​(int i)
                           throws InvalidParameterException
        defines height of the header or footer area
        Parameters:
        i - height in points; "-1" value forces PD4ML to predict HTML header or footer height and to use the calculated value.
        Throws:
        InvalidParameterException
      • getFont

        public Font getFont()
        returns font currently used for header or footer
        Returns:
        header/footer font
      • getFont

        public Font getFont​(int pageNumber)
        returns font currently used for header or footer The method can be overridden in order to add page dependent header/footer font definition
        Parameters:
        pageNumber - destination page number
        Returns:
        header/footer font for specified page
      • getFontSize

        public int getFontSize()
        Returns:
        font size
        See Also:
        setFontSize(int)
      • setColor

        public void setColor​(Color color)
        setColor() sets the color of header or footer text
        Parameters:
        color -
      • getPageBackgroundColor

        public Color getPageBackgroundColor​(int pageNumber)
        returns background color for the specified page The method can be overridden in order to add page dependent color definition
        Parameters:
        pageNumber - destination page number
        Returns:
        background color for the specified page
      • getPageBackgroundImageUrl

        public String getPageBackgroundImageUrl​(int pageNumber)
        returns background image URL for the specified page The method can be overridden in order to add page dependent background image definition
        Parameters:
        pageNumber - destination page number
        Returns:
        background image URL for the specified page
      • getPageBackgroundColor

        public Color getPageBackgroundColor()
        returns default page background color
        Returns:
        background color
      • setPageBackgroundColor

        public void setPageBackgroundColor​(Color pageBackgroundColor)
        defines default page background color
        Parameters:
        pageBackgroundColor -
      • getPageBackgroundImageUrl

        public String getPageBackgroundImageUrl()
        returns default page background image URL
        Returns:
        background image URL
      • setPageBackgroundImageUrl

        public void setPageBackgroundImageUrl​(String pageBackgroundImageUrl)
        defines default page background image (form, letterhead)
        Parameters:
        pageBackgroundImageUrl -
      • firstPageDiffers

        public boolean firstPageDiffers()
        checks if the header/footer definition for the first page differs the default definition