org.apache.fop.pdf

## Class PDFGState

- java.lang.Object
- - org.apache.fop.pdf.PDFObject
  - - org.apache.fop.pdf.PDFGState

- All Implemented Interfaces:
    PDFWritable

      public class PDFGState
      extends PDFObject

  Class representing a /ExtGState object.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PDFGState` | `DEFAULT` Default GState object
    `static java.lang.String` | `GSTATE_ALPHA_NONSTROKE` Nonstroking Alpha (ca, PDF 1.4)
    `static java.lang.String` | `GSTATE_ALPHA_SOURCE_FLAG` Alpha Source Flag (AIS, PDF 1.4)
    `static java.lang.String` | `GSTATE_ALPHA_STROKE` Stroking Alpha (CA, PDF 1.4)
    `static java.lang.String` | `GSTATE_BLACK_GENERATION` Black generation (BG)
    `static java.lang.String` | `GSTATE_BLACK_GENERATION2` Black generation with default (BG2)
    `static java.lang.String` | `GSTATE_BLEND_MODE` Blend mode (BM, PDF 1.4)
    `static java.lang.String` | `GSTATE_DASH_PATTERN` Dash pattern (D)
    `static java.lang.String` | `GSTATE_FLATNESS` Flatness (FL)
    `static java.lang.String` | `GSTATE_FONT` Font (Font)
    `static java.lang.String` | `GSTATE_HALFTONE_DICT` Halftone dictionary or stream (HT)
    `static java.lang.String` | `GSTATE_HALFTONE_PHASE` Halftone phase (HTP, does not show up anymore in PDF 1.4)
    `static java.lang.String` | `GSTATE_LINE_CAP` Line cap (LC)
    `static java.lang.String` | `GSTATE_LINE_JOIN` Line join (LJ)
    `static java.lang.String` | `GSTATE_LINE_WIDTH` Line width (LW)
    `static java.lang.String` | `GSTATE_MITER_LIMIT` Miter limit (ML)
    `static java.lang.String` | `GSTATE_OVERPRINT_FILL` Overprint for fill (op)
    `static java.lang.String` | `GSTATE_OVERPRINT_MODE` Overprint mode (OPM)
    `static java.lang.String` | `GSTATE_OVERPRINT_STROKE` Overprint for stroke (OP)
    `static java.lang.String` | `GSTATE_RENDERING_INTENT` Rendering intent (RI)
    `static java.lang.String` | `GSTATE_SMOOTHNESS` Smoothness (SM)
    `static java.lang.String` | `GSTATE_SOFT_MASK` Soft mask (SMask, PDF 1.4)
    `static java.lang.String` | `GSTATE_STRIKE_ADJ` Strike adjustment (SA)
    `static java.lang.String` | `GSTATE_TEXT_KNOCKOUT` Text Knockout Flag (TK, PDF 1.4)
    `static java.lang.String` | `GSTATE_TRANSFER_FUNCTION` Transfer function (TR)
    `static java.lang.String` | `GSTATE_TRANSFER_FUNCTION2` Transfer function with default (TR2)
    `static java.lang.String` | `GSTATE_UNDERCOLOR_REMOVAL` Undercolor removal function (UCR)
    `static java.lang.String` | `GSTATE_UNDERCOLOR_REMOVAL2` Undercolor removal function with default (UCR2)

    - ### Fields inherited from class org.apache.fop.pdf.PDFObject

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFGState()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addValues(java.util.Map vals)` Adds all values from a Map to this object.
    `void` | `addValues(PDFGState state)` Adds all values from another GState object to this one.
    `protected boolean` | `contentEquals(PDFObject obj)` Check if the other PDFObject has the same content as the current object.
    `java.lang.String` | `getName()` Returns the name of this object
    `void` | `setAlpha(float val, boolean fill)` Sets the alpha value.
    `java.lang.String` | `toPDFString()` This method returns a String representation of the PDF object.

    - ### Methods inherited from class org.apache.fop.pdf.PDFObject

      `encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GSTATE_LINE_WIDTH

          public static final java.lang.String GSTATE_LINE_WIDTH

      Line width (LW)
      See Also:
        Constant Field Values

    - #### GSTATE_LINE_CAP

          public static final java.lang.String GSTATE_LINE_CAP

      Line cap (LC)
      See Also:
        Constant Field Values

    - #### GSTATE_LINE_JOIN

          public static final java.lang.String GSTATE_LINE_JOIN

      Line join (LJ)
      See Also:
        Constant Field Values

    - #### GSTATE_MITER_LIMIT

          public static final java.lang.String GSTATE_MITER_LIMIT

      Miter limit (ML)
      See Also:
        Constant Field Values

    - #### GSTATE_DASH_PATTERN

          public static final java.lang.String GSTATE_DASH_PATTERN

      Dash pattern (D)
      See Also:
        Constant Field Values

    - #### GSTATE_RENDERING_INTENT

          public static final java.lang.String GSTATE_RENDERING_INTENT

      Rendering intent (RI)
      See Also:
        Constant Field Values

    - #### GSTATE_OVERPRINT_STROKE

          public static final java.lang.String GSTATE_OVERPRINT_STROKE

      Overprint for stroke (OP)
      See Also:
        Constant Field Values

    - #### GSTATE_OVERPRINT_FILL

          public static final java.lang.String GSTATE_OVERPRINT_FILL

      Overprint for fill (op)
      See Also:
        Constant Field Values

    - #### GSTATE_OVERPRINT_MODE

          public static final java.lang.String GSTATE_OVERPRINT_MODE

      Overprint mode (OPM)
      See Also:
        Constant Field Values

    - #### GSTATE_FONT

          public static final java.lang.String GSTATE_FONT

      Font (Font)
      See Also:
        Constant Field Values

    - #### GSTATE_BLACK_GENERATION

          public static final java.lang.String GSTATE_BLACK_GENERATION

      Black generation (BG)
      See Also:
        Constant Field Values

    - #### GSTATE_BLACK_GENERATION2

          public static final java.lang.String GSTATE_BLACK_GENERATION2

      Black generation with default (BG2)
      See Also:
        Constant Field Values

    - #### GSTATE_UNDERCOLOR_REMOVAL

          public static final java.lang.String GSTATE_UNDERCOLOR_REMOVAL

      Undercolor removal function (UCR)
      See Also:
        Constant Field Values

    - #### GSTATE_UNDERCOLOR_REMOVAL2

          public static final java.lang.String GSTATE_UNDERCOLOR_REMOVAL2

      Undercolor removal function with default (UCR2)
      See Also:
        Constant Field Values

    - #### GSTATE_TRANSFER_FUNCTION

          public static final java.lang.String GSTATE_TRANSFER_FUNCTION

      Transfer function (TR)
      See Also:
        Constant Field Values

    - #### GSTATE_TRANSFER_FUNCTION2

          public static final java.lang.String GSTATE_TRANSFER_FUNCTION2

      Transfer function with default (TR2)
      See Also:
        Constant Field Values

    - #### GSTATE_HALFTONE_DICT

          public static final java.lang.String GSTATE_HALFTONE_DICT

      Halftone dictionary or stream (HT)
      See Also:
        Constant Field Values

    - #### GSTATE_HALFTONE_PHASE

          public static final java.lang.String GSTATE_HALFTONE_PHASE

      Halftone phase (HTP, does not show up anymore in PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_FLATNESS

          public static final java.lang.String GSTATE_FLATNESS

      Flatness (FL)
      See Also:
        Constant Field Values

    - #### GSTATE_SMOOTHNESS

          public static final java.lang.String GSTATE_SMOOTHNESS

      Smoothness (SM)
      See Also:
        Constant Field Values

    - #### GSTATE_STRIKE_ADJ

          public static final java.lang.String GSTATE_STRIKE_ADJ

      Strike adjustment (SA)
      See Also:
        Constant Field Values

    - #### GSTATE_BLEND_MODE

          public static final java.lang.String GSTATE_BLEND_MODE

      Blend mode (BM, PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_SOFT_MASK

          public static final java.lang.String GSTATE_SOFT_MASK

      Soft mask (SMask, PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_ALPHA_STROKE

          public static final java.lang.String GSTATE_ALPHA_STROKE

      Stroking Alpha (CA, PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_ALPHA_NONSTROKE

          public static final java.lang.String GSTATE_ALPHA_NONSTROKE

      Nonstroking Alpha (ca, PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_ALPHA_SOURCE_FLAG

          public static final java.lang.String GSTATE_ALPHA_SOURCE_FLAG

      Alpha Source Flag (AIS, PDF 1.4)
      See Also:
        Constant Field Values

    - #### GSTATE_TEXT_KNOCKOUT

          public static final java.lang.String GSTATE_TEXT_KNOCKOUT

      Text Knockout Flag (TK, PDF 1.4)
      See Also:
        Constant Field Values

    - #### DEFAULT

          public static final PDFGState DEFAULT

      Default GState object

  - ### Constructor Detail

    - #### PDFGState

          public PDFGState()

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Returns the name of this object
      Returns:
        the name

    - #### setAlpha

          public void setAlpha(float val,
                      boolean fill)

      Sets the alpha value.
      Parameters:
        `val` - alpha value (0.0 - 1.0)
        `fill` - True if alpha should be set for non-stroking operations, False if for stroking operations

    - #### addValues

          public void addValues(PDFGState state)

      Adds all values from another GState object to this one.
      Parameters:
        `state` - source object to copy from

    - #### addValues

          public void addValues(java.util.Map vals)

      Adds all values from a Map to this object.
      Parameters:
        `vals` - source object to copy from

    - #### toPDFString

          public java.lang.String toPDFString()

      This method returns a String representation of the PDF object. The result is normally converted/encoded to a byte array by toPDF(). Only use this method to implement the serialization if the object can be fully represented as text. If the PDF representation of the object contains binary content use toPDF() or output(OutputStream) instead. This applies to any object potentially containing a string object because string object are encrypted and therefore need to be binary.
      Overrides:
        `toPDFString` in class `PDFObject`
      Returns:
        String the String representation

    - #### contentEquals

          protected boolean contentEquals(PDFObject obj)

      Check if the other PDFObject has the same content as the current object.

      Note: This function has a contract which is less binding than `Object.equals(Object)`. Whereas equals would require all values to be identical, this method is not required to check everything. In the case of PDFObjects, this means that the overriding function does not have to check for `PDFObject.getObjectID()`.

      Overrides:
        `contentEquals` in class `PDFObject`
      Parameters:
        `obj` - object to compare to.
      Returns:
        true if the other object has the same content.

Copyright 1999-2019 The Apache Software Foundation. All Rights Reserved.