Class PdfTextArray

  • All Implemented Interfaces:
    java.lang.Iterable<PdfObject>

    public class PdfTextArray
    extends PdfArray
    PdfTextArray defines an array with displacements and PdfString-objects.

    A PdfTextArray is used with the operator TJ in PdfCanvas. The first object in this array has to be a PdfString; see reference manual version 1.3 section 8.7.5, pages 346-347. OR see reference manual version 1.6 section 5.3.2, pages 378-379. To emit a more efficient array, we consolidate repeated numbers or strings into single array entries. For example: "add( 50 ); add( -50 );" will REMOVE the combined zero from the array.

    • Field Detail

      • lastNumber

        private float lastNumber
      • lastString

        private java.lang.StringBuilder lastString
    • Constructor Detail

      • PdfTextArray

        public PdfTextArray()
    • Method Detail

      • addAll

        public void addAll​(PdfArray a)
        Adds content of the PdfArray.
        Overrides:
        addAll in class PdfArray
        Parameters:
        a - the PdfArray to be added
        See Also:
        List.addAll(java.util.Collection)
      • addAll

        public void addAll​(java.util.Collection<PdfObject> c)
        Adds the Collection of PdfObjects.
        Overrides:
        addAll in class PdfArray
        Parameters:
        c - the Collection of PdfObjects to be added
        See Also:
        List.addAll(java.util.Collection)
      • add

        public boolean add​(float number)
      • add

        public boolean add​(java.lang.String text,
                           PdfFont font)
      • add

        public boolean add​(byte[] text)
      • add

        protected boolean add​(java.lang.String text)