Class ClipperBridge

java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.clipper.ClipperBridge

public final class ClipperBridge extends Object
This class contains a variety of methods allowing the conversion of iText abstractions into abstractions of the Clipper library, and vice versa.

For example:

  • Field Details

    • MAX_ALLOWED_VALUE

      private static final long MAX_ALLOWED_VALUE
      See Also:
    • floatMultiplier

      public static Double floatMultiplier
      Since the clipper library uses integer coordinates, we should convert our floating point numbers into fixed point numbers by multiplying by this coefficient. Vary it to adjust the preciseness of the calculations.

      Note that if this value is specified, it will be used for all ClipperBridge instances and dynamic float multiplier calculation will be disabled.

    • approximatedFloatMultiplier

      private double approximatedFloatMultiplier
  • Constructor Details

    • ClipperBridge

      public ClipperBridge()
      Creates new ClipperBridge instance with default float multiplier value which is 10^14.

      Since the clipper library uses integer coordinates, we should convert our floating point numbers into fixed point numbers by multiplying by float multiplier coefficient. It is possible to vary it to adjust the preciseness of the calculations: if static floatMultiplier is specified, it will be used for all ClipperBridge instances and default value will be ignored.

    • ClipperBridge

      public ClipperBridge(Path... paths)
      Creates new ClipperBridge instance with adjusted float multiplier value. This instance will work correctly with the provided paths only.

      Since the clipper library uses integer coordinates, we should convert our floating point numbers into fixed point numbers by multiplying by float multiplier coefficient. It is calculated automatically, however it is possible to vary it to adjust the preciseness of the calculations: if static floatMultiplier is specified, it will be used for all ClipperBridge instances and automatic calculation won't work.

      Parameters:
      paths - paths to calculate multiplier coefficient to convert floating point numbers into fixed point numbers
    • ClipperBridge

      public ClipperBridge(Point[]... points)
      Creates new ClipperBridge instance with adjusted float multiplier value. This instance will work correctly with the provided point only.

      Since the clipper library uses integer coordinates, we should convert our floating point numbers into fixed point numbers by multiplying by float multiplier coefficient. It is calculated automatically, however it is possible to vary it to adjust the preciseness of the calculations: if static floatMultiplier is specified, it will be used for all ClipperBridge instances and automatic calculation won't work.

      Parameters:
      points - points to calculate multiplier coefficient to convert floating point numbers into fixed point numbers
  • Method Details