Class PDBorderStyleDictionary

  • All Implemented Interfaces:
    COSObjectable

    public class PDBorderStyleDictionary
    extends java.lang.Object
    implements COSObjectable
    This class represents a PDF /BS entry the border style dictionary.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private COSDictionary dictionary  
      static java.lang.String STYLE_BEVELED
      Constant for the name of a beveled style.
      static java.lang.String STYLE_DASHED
      Constant for the name of a dashed style.
      static java.lang.String STYLE_INSET
      Constant for the name of a inset style.
      static java.lang.String STYLE_SOLID
      Constant for the name of a solid style.
      static java.lang.String STYLE_UNDERLINE
      Constant for the name of a underline style.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      COSDictionary getCOSObject()
      returns the dictionary.
      PDLineDashPattern getDashStyle()
      This will retrieve the dash style used for drawing the border.
      java.lang.String getStyle()
      This will retrieve the border style, see the STYLE_* constants for valid values.
      float getWidth()
      This will retrieve the border width in points, 0 = no border.
      void setDashStyle​(COSArray dashArray)
      This will set the dash style used for drawing the border.
      void setStyle​(java.lang.String s)
      This will set the border style, see the STYLE_* constants for valid values.
      void setWidth​(float w)
      This will set the border width in points, 0 = no border.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STYLE_SOLID

        public static final java.lang.String STYLE_SOLID
        Constant for the name of a solid style.
        See Also:
        Constant Field Values
      • STYLE_DASHED

        public static final java.lang.String STYLE_DASHED
        Constant for the name of a dashed style.
        See Also:
        Constant Field Values
      • STYLE_BEVELED

        public static final java.lang.String STYLE_BEVELED
        Constant for the name of a beveled style.
        See Also:
        Constant Field Values
      • STYLE_INSET

        public static final java.lang.String STYLE_INSET
        Constant for the name of a inset style.
        See Also:
        Constant Field Values
      • STYLE_UNDERLINE

        public static final java.lang.String STYLE_UNDERLINE
        Constant for the name of a underline style.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PDBorderStyleDictionary

        public PDBorderStyleDictionary()
        Constructor.
      • PDBorderStyleDictionary

        public PDBorderStyleDictionary​(COSDictionary dict)
        Constructor.
        Parameters:
        dict - a border style dictionary.
    • Method Detail

      • setWidth

        public void setWidth​(float w)
        This will set the border width in points, 0 = no border. There is a bug in Adobe Reader DC, float values are ignored for text field widgets. As a workaround, floats that are integers (e.g. 2.0) are written as integer in the PDF.

        In Adobe Acrobat DC, the values are shown as "0 = Invisible, 1 = Thin, 2 = Medium, 3 = Thick" for widget and link annotations.

        Parameters:
        w - float the width in points
      • getWidth

        public float getWidth()
        This will retrieve the border width in points, 0 = no border.
        Returns:
        The width of the border in points.
      • setStyle

        public void setStyle​(java.lang.String s)
        This will set the border style, see the STYLE_* constants for valid values.
        Parameters:
        s - the border style to use
      • getStyle

        public java.lang.String getStyle()
        This will retrieve the border style, see the STYLE_* constants for valid values.
        Returns:
        the style of the border
      • setDashStyle

        public void setDashStyle​(COSArray dashArray)
        This will set the dash style used for drawing the border.
        Parameters:
        dashArray - the dash style to use
      • getDashStyle

        public PDLineDashPattern getDashStyle()
        This will retrieve the dash style used for drawing the border.
        Returns:
        the dash style of the border