Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Stamp

desc

Given a position and dimensions add the provided image to the provided pdf

property

pdf - the path to the original pdf

property

image - the image as a data uri

property

coordinates - pdf coordinates

property

dimensions - image dimensions

property

target - the page name after the document has gone through Stamp#_burst

property

out - the output file path

Hierarchy

  • Stamp

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

out

pdf

pdf file path

target

target: string
description

the page name after the document has gone through burst

see

Stamp.burst

Methods

Private _stamp

  • _stamp(imgs: Array<ImgOpts>): Promise<string>
  • desc

    Generates a new pdf with image at the provided coordinates and dimensions

    Parameters

    Returns Promise<string>

    -

burst

  • burst(): Promise<string[]>
  • desc

    Burst file into individual pages. Files written to /tmp with documentId prefix

    todo:

    The find operation will return an error for any file without x permission in /tmp directory the current work around is to ignore stderr in this process. Trying to grep filter 'Permission denied' has not yet worked.

    Returns Promise<string[]>

    • list of file names, ex. page_1.pdf, page_2.pdf, etc...

write

  • write(page: number, srcs: Array<ImgOpts>): Promise<string>
  • desc

    Write new pdf with image stamp.

    Parameters

    • page: number

      page index to apply image

    • srcs: Array<ImgOpts>

      stamp positioning

    Returns Promise<string>

    • output file location

Static pageIndex

  • pageIndex(page: string): number
  • description

    Parse the page name generated from burst to an integer

    static

    Parameters

    • page: string

      filename

    Returns number

Generated using TypeDoc