Class PdfUtils

  • All Implemented Interfaces:

    
    public class PdfUtils
    
                        

    Collection of useful methods for working with PDF documents.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      PdfUtils()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static RectF createPdfRectUnion(List<RectF> pdfRects) Creates a union of a list of pdfRects.
      static RectF boundingBoxFromLines(List<List<PointF>> lines, @FloatRange(from = 0.0) float lineWidth) Calculates the bounding box from lines (specified in PDF coordinates).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PdfUtils

        PdfUtils()
    • Method Detail

      • createPdfRectUnion

        @NonNull() static RectF createPdfRectUnion(List<RectF> pdfRects)

        Creates a union of a list of pdfRects. The provided pdfRects have to be in the PDF coordinate space. Examples for rects used with this method are pageRects, or the getBoundingBox.

        Parameters:
        pdfRects - List of PDF rects on which to apply the union.
      • boundingBoxFromLines

        @NonNull() static RectF boundingBoxFromLines(List<List<PointF>> lines, @FloatRange(from = 0.0) float lineWidth)

        Calculates the bounding box from lines (specified in PDF coordinates).

        Parameters:
        lines - List of lines, where line is defined by the list of points in PDF coordinates.
        lineWidth - Line width in PDF points.
        Returns:

        A rect defining the bounding box around the specified lines, including the width in calculations.