PDFRectangle (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.pdf

## Class PDFRectangle

- java.lang.Object
- - org.apache.fop.pdf.PDFRectangle

- All Implemented Interfaces:
    PDFWritable

      public class PDFRectangle
      extends Object
      implements PDFWritable

  class representing a rectangle Rectangles are specified on page 183 of the PDF 1.3 spec.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `llx` lower left x coordinate
    `protected int` | `lly` lower left y coordinate
    `protected int` | `urx` upper right x coordinate
    `protected int` | `ury` upper right y coordinate

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFRectangle(int[] array)` create a rectangle giving an array of four values
    `PDFRectangle(int llx, int lly, int urx, int ury)` create a rectangle giving the four separate values

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `outputInline(OutputStream out, StringBuilder textBuffer)` Writes a "direct object" (inline object) representation to the stream.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### llx

          protected int llx

      lower left x coordinate

    - #### lly

          protected int lly

      lower left y coordinate

    - #### urx

          protected int urx

      upper right x coordinate

    - #### ury

          protected int ury

      upper right y coordinate

  - ### Constructor Detail

    - #### PDFRectangle

          public PDFRectangle(int llx,
                              int lly,
                              int urx,
                              int ury)

      create a rectangle giving the four separate values
      Parameters:
        `llx` - lower left x coordinate
        `lly` - lower left y coordinate
        `urx` - upper right x coordinate
        `ury` - upper right y coordinate

    - #### PDFRectangle

          public PDFRectangle(int[] array)

      create a rectangle giving an array of four values
      Parameters:
        `array` - values in the order llx, lly, urx, ury

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### outputInline

          public void outputInline(OutputStream out,
                                   StringBuilder textBuffer)
                            throws IOException

      Writes a "direct object" (inline object) representation to the stream. A text buffer is given for optimized encoding of text content.

      IMPORTANT: If you need to write out binary output, call `PDFDocument.flushTextBuffer(StringBuilder, OutputStream)` before writing any content to the `OutputStream`!

      Specified by:
        `outputInline` in interface `PDFWritable`
      Parameters:
        `out` - the OutputStream (for binary content)
        `textBuffer` - the text buffer for text content
      Throws:
        `IOException` - if an I/O error occurs

Copyright © 2025 Apache Software Foundation. All rights reserved.