Class PathOffsetApproximationProperties

java.lang.Object
com.itextpdf.pdfcleanup.PathOffsetApproximationProperties

public class PathOffsetApproximationProperties extends Object
Contains properties for ClipperOffset operations.
  • Constructor Details

  • Method Details

    • calculateOffsetMultiplierDynamically

      public PathOffsetApproximationProperties calculateOffsetMultiplierDynamically (boolean calculateDynamically)
      Specifies if floatMultiplier should be calculated dynamically. Default value is false.

      When a document with line arts is being cleaned up, there are a lot of calculations with floating point numbers. All of them are translated into fixed point numbers by multiplying by this floatMultiplier coefficient. It is possible to dynamically adjust the preciseness of the calculations.

      Parameters:
      calculateDynamically - true if floatMultiplier should be calculated dynamically, false for default value specified by ClipperBridge()
      Returns:
      this PathOffsetApproximationProperties instance
    • calculateOffsetMultiplierDynamically

      public boolean calculateOffsetMultiplierDynamically()
      Checks whether floatMultiplier should be calculated dynamically.

      When a document with line arts is being cleaned up, there are a lot of calculations with floating point numbers. All of them are translated into fixed point numbers by multiplying by this floatMultiplier coefficient. It is possible to dynamically adjust the preciseness of the calculations.

      Returns:
      true if floatMultiplier should be calculated dynamically, false for default value
    • getArcTolerance

      public double getArcTolerance()
      Gets arc tolerance which is the maximum difference between the true and the faceted representation of curves (arcs) in units. Used as the criterion of a good approximation of rounded line joins and line caps.

      Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable imprecision (tolerance) when arcs are approximated in an offsetting operation. Smaller values will increase smoothness up to a point though at a cost of performance and in creating more vertices to construct the arc.

      Returns:
      arc tolerance specifying maximum difference between the true and the faceted representation of arcs
    • setArcTolerance

      public PathOffsetApproximationProperties setArcTolerance (double arcTolerance)
      Sets arc tolerance which is the maximum difference between the true and the faceted representation of curves (arcs) in units. Used as the criterion of a good approximation of rounded line joins and line caps.

      Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable imprecision (tolerance) when arcs are approximated in an offsetting operation. Smaller values will increase smoothness up to a point though at a cost of performance and in creating more vertices to construct the arc.

      Parameters:
      arcTolerance - maximum difference between the true and the faceted representation of arcs
      Returns:
      this PathOffsetApproximationProperties instance