Accessors

  • get isDraft(): boolean
  • Returns boolean

  • get pageCount(): number
  • Returns number

Methods

  • Parameters

    • generatorOptions: {
          attributes?: { author?: string; creator?: string; title?: string; subject?: string; keywords?: string; _marker?: () => void; };
          dpi?: number;
          jpegQuality?: number;
          pageDirection?: PageDirection;
          pageFit?: PageFit;
          pageSize?: PageSize;
          resamplingMethod?: ResamplingMethod;
      }
      • Optional attributes?: { author?: string; creator?: string; title?: string; subject?: string; keywords?: string; _marker?: () => void; }

        Attributes.

        Default Value

        new PdfAttributes({});
        
      • Optional dpi?: number

        The dpi parameter has two different meanings depending on the value of pageSize and pageFit. If pageSize is CUSTOM or pageFit is NONE, then dpi is the conversion ratio used to convert from units of pixels to physical inches when adding bitmap images (JPEG, PNG, or raw) to the PDF. Otherwise, if resamplingMethod is not NONE, then the image is downscaled if necessary (if the image after being fit to the page has a higher calculated DPI than dpi) to match dpi before adding it to the PDF. Otherwise, the setting is ignored and the calculated image DPI is used instead.

        Default Value

        72;
        
      • Optional jpegQuality?: number

        JPEG quality for images. Applies if an image is added as a cv::Mat and therefore needs to be encoded. Also applies if resamplingMethod not NONE and the image being added needs to be downscaled. Otherwise, when adding JPEG files to the PDF, the files are copied directly into the PDF and not re-encoded, which is many times faster and also preserves the quality of the original.

        Default Value

        80;
        
      • Optional pageDirection?: PageDirection

        Page direction.

        Default Value

        "PORTRAIT";
        
      • Optional pageFit?: PageFit

        How to fit the image into the page. Only used if pageSize is not CUSTOM. The image can either be stretched to fill the page, in one of three ways, or centered on the page without stretching.

        Default Value

        "FIT_IN";
        
      • Optional pageSize?: PageSize

        Physical size of the page. If CUSTOM, the page size will be set as the image size at given dpi.

        Default Value

        "A4";
        
      • Optional resamplingMethod?: ResamplingMethod

        Resampling method.

        Default Value

        "NONE";
        

    Returns Promise<ArrayBuffer>

  • Parameters

    • Optional generatorOptions: {
          binarizationFilter?: ({ readonly _type?: "ScanbotBinarizationFilter"; outputMode?: OutputMode; _marker?: () => void; }) | ({ readonly _type?: "CustomBinarizationFilter"; outputMode?: OutputMode; denoise?: number; radius?: number; preset?: BinarizationFilterPreset; _marker?: () => void; }) | ({ readonly _type?: "ColorDocumentFilter"; _marker?: () => void; }) | ({ readonly _type?: "BrightnessFilter"; brightness?: number; _marker?: () => void; }) | ({ readonly _type?: "ContrastFilter"; contrast?: number; _marker?: () => void; }) | ({ readonly _type?: "GrayscaleFilter"; borderWidthFraction?: number; blackOutliersFraction?: number; whiteOutliersFraction?: number; _marker?: () => void; }) | ({ readonly _type?: "LegacyFilter"; filterType?: number; _marker?: () => void; }) | ({ readonly _type?: "WhiteBlackPointFilter"; blackPoint?: number; whitePoint?: number; _marker?: () => void; });
          compression?: CompressionMode;
          dpi?: number;
          jpegQuality?: number;
          userFields?: ({ tag?: number; name?: string; value?: { readonly _type?: "UserFieldDoubleValue"; value?: number; _marker?: () => void; } | { readonly _type?: "UserFieldStringValue"; value?: string; _marker?: () => void; } | { ...; }; _marker?: () => void; })[];
          zipCompressionLevel?: number;
      }
      • Optional binarizationFilter?: ({ readonly _type?: "ScanbotBinarizationFilter"; outputMode?: OutputMode; _marker?: () => void; }) | ({ readonly _type?: "CustomBinarizationFilter"; outputMode?: OutputMode; denoise?: number; radius?: number; preset?: BinarizationFilterPreset; _marker?: () => void; }) | ({ readonly _type?: "ColorDocumentFilter"; _marker?: () => void; }) | ({ readonly _type?: "BrightnessFilter"; brightness?: number; _marker?: () => void; }) | ({ readonly _type?: "ContrastFilter"; contrast?: number; _marker?: () => void; }) | ({ readonly _type?: "GrayscaleFilter"; borderWidthFraction?: number; blackOutliersFraction?: number; whiteOutliersFraction?: number; _marker?: () => void; }) | ({ readonly _type?: "LegacyFilter"; filterType?: number; _marker?: () => void; }) | ({ readonly _type?: "WhiteBlackPointFilter"; blackPoint?: number; whitePoint?: number; _marker?: () => void; })

        Filter to apply to the input image when adding pages with binarization. If set, the filter is applied to the input image and the resulting image is stored as a 1-bit TIFF. When storing documents it's typically best to use the BINARY_DOCUMENT_OPTIMIZED_COMPRESSION compression mode (CCITTFAX4) instead of the default, as it tends to produce the smallest file sizes. If not set, simple thresholding is applied to the image, instead.

        Default Value

        null;
        
      • Optional compression?: CompressionMode

        Compression.

        Default Value

        "LZW";
        
      • Optional dpi?: number

        DPI value.

        Default Value

        72;
        
      • Optional jpegQuality?: number

        JPEG quality (TIFFTAG_JPEGQUALITY). Values range from 0 to 100.

        Default Value

        80;
        
      • Optional userFields?: ({ tag?: number; name?: string; value?: { readonly _type?: "UserFieldDoubleValue"; value?: number; _marker?: () => void; } | { readonly _type?: "UserFieldStringValue"; value?: string; _marker?: () => void; } | { ...; }; _marker?: () => void; })[]

        User-defined fields.

        Default Value

        [];
        
      • Optional zipCompressionLevel?: number

        ZIP/Deflate compression level (TIFFTAG_ZIPQUALITY). Values range from 1 to 9.

        Default Value

        6;
        
    • Optional pageOptions: Omit<TiffPageOptions, "consumeImage">

    Returns Promise<ArrayBuffer>

  • Parameters

    • index: number
    • polygon: Point[]
    • rotations: number

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • position: number

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Returns Promise<boolean>

  • Returns Promise<boolean>

  • Returns Promise<ArrayBuffer>

  • Returns Promise<ArrayBuffer>

  • Parameters

    • from: number
    • to: number

    Returns Promise<void>

  • Parameters

    • position: number

    Returns SBPage

  • Returns Promise<number>

  • Parameters

    • documentId: number

    Returns Promise<SBDocument>

Generated using TypeDoc