Options
All
  • Public
  • Public/Protected
  • All
Menu

from-data-to-pdf

Index

Functions

closeBrowser

  • closeBrowser(browser: Browser): Promise<void>
  • author

    DOUAL Sofian

    description

    Close given browser.

    Parameters

    • browser: Browser

    Returns Promise<void>

fromHtmlFileToPdf

  • author

    DOUAL Sofian

    description

    Get html files and carries out the process.

    Parameters

    Returns Promise<FileBuffer[]>

fromHtmlFileToString

  • author

    DOUAL Sofian

    description

    Converts HTML files to string.

    Parameters

    Returns Promise<FileBuffer[]>

generateBuffer

  • author

    DOUAL Sofian

    description

    If path is undefined, returns an array of PDFS buffer. Otherwise, return the path of the saved PDF files.

    Parameters

    • browser: Browser
    • targets: FileBuffer[]
    • Optional path: string

    Returns Promise<FileBuffer[]>

getPdf

  • author

    DOUAL Sofian

    description

    Carries out the process without to get local files.

    Parameters

    • targets: FileBuffer[]
    • save: boolean
    • Optional path: string

    Returns Promise<FileBuffer[]>

initBrowser

  • initBrowser(): Promise<Browser>
  • author

    DOUAL Sofian

    description

    Return a browser.

    Returns Promise<Browser>

initDefaultFolder

  • initDefaultFolder(): Promise<boolean>
  • author

    DOUAL Sofian

    description

    Create folders /myApp/temp, /myApp/temp/target, /myApp/temp/generatedPDF.

    Returns Promise<boolean>

savePDF

  • author

    DOUAL Sofian

    description

    Save the buffer as a PDF file in /temp/generatedPDF/.

    Parameters

    Returns Promise<FileBuffer[]>

setPath

  • setPath(path?: string): string
  • author

    DOUAL Sofian

    description

    It returns the path of the app directory if path param does not exists. Else if path param exists and it is a relative path, this method joins it with the path of app directory to finally returns the result as string. Else if path param exists and it is an absolute path, this methods return it.

    Parameters

    • Optional path: string

    Returns string

Generated using TypeDoc