Class DefaultLineBuilderStrategy

java.lang.Object
org.apache.camel.component.pdf.text.DefaultLineBuilderStrategy
All Implemented Interfaces:
LineBuilderStrategy

public class DefaultLineBuilderStrategy extends Object implements LineBuilderStrategy
Builds lines from words based on line width and PDF document page size. Built lines then will be written to pdf document.
  • Constructor Details

    • DefaultLineBuilderStrategy

      public DefaultLineBuilderStrategy(PdfConfiguration pdfConfiguration)
  • Method Details

    • buildLines

      public Collection<String> buildLines(Collection<String> splittedText) throws IOException
      Builds lines from words. Utilizes the same behaviour as office software:
      • If word doesn't fit in current line, and current lines contains other words, then it will be moved to new line.
      • Word doesn't fit in the line and line does not contain other words, then word will be slitted, and split index will be on max amount of characters that fits in the line
      Specified by:
      buildLines in interface LineBuilderStrategy
      Throws:
      IOException
    • getAllowedLineWidth

      public float getAllowedLineWidth()