Class Line

java.lang.Object
io.keikai.doc.io.schema.pdf.Line

public class Line extends Object
Internal Use Only.

Represents a line in a paragraph in PDF.

Author:
Jamson Chan
  • Constructor Details

    • Line

      public Line(float leftX, float rightX, PDFParagraph pdfParagraph)
      Create a Line instance.
      Parameters:
      leftX - the left x position of the line
      rightX - the right x position of the line
      pdfParagraph - the PDFParagraph containing the line
  • Method Details

    • getInlines

      public List<PDFInline> getInlines()
      Returns the PDFInlines in the line.
      Returns:
      the PDFInlines in the line.
    • addInlines

      public void addInlines(Line.InlineItem inlineItem)
      Add PDFInlines by given Line.InlineItem.
      Parameters:
      inlineItem - the Line.InlineItem containing the PDFInlines to add
    • getLeftX

      public float getLeftX()
      Returns the left x position of the line.
      Returns:
      the left x position of the line
    • getRightX

      public float getRightX()
      Returns the right x position of the line.
      Returns:
      the right x position of the line
    • getWidth

      public float getWidth()
      Returns the width of the line.
      Returns:
      the width of the line
    • getRealHeight

      public float getRealHeight()
      Returns the real height of the line.

      The height of a line is the maximum height of all the inlines (texts and components) in the line.

      Returns:
      the real height of the line
    • getParagraphTypeExtraMargin

      public float getParagraphTypeExtraMargin()
      Returns the extra vertical margin provides by different paragraph type.

      It can represent margin-top and margin-bottom.

      Returns:
      the extra vertical margin provides by different paragraph type
    • getLineHeightExtraPadding

      public float getLineHeightExtraPadding()
      Returns the extra vertical padding provides by different line height value.

      It can represent after padding-top and padding-bottom.

      Returns:
      the extra vertical padding provides by different line height value
    • getNonSuffixSpacesCount

      public int getNonSuffixSpacesCount()
      Returns the number of non-suffix spaces in the line.
      Returns:
      the number of non-suffix spaces in the line
    • getWidthExceptSuffixSpaces

      public float getWidthExceptSuffixSpaces()
      Returns the total width ignores the suffix spaces.

      Note that this width could start from text or space, and MUST be ends with text.

      Returns:
      the total width of the text in the line
    • getNonSpaceWidth

      public float getNonSpaceWidth()
      Returns the sum width of all the text (non-space) in the line.
      Returns:
      the sum width of all the text (non-space) in the line.