identify

GM command - identify

identify(filepath: String, argument: Mixed): Promise
Parameters
filepath (String) path to valid file
argument (Mixed) gm identify argument
Returns
Promise: Promise

graphicMagickBaseCommand

Initialize base graphicmagick setup.

graphicMagickBaseCommand(stream: Stream, filename: String): gm
Parameters
stream (Stream) fs stream
filename (String) save file name
Returns
gm: graphicsmagick object

writeImage

GM command - write

writeImage(stream: Stream, output: String, filename: String, page: Integer): Promise
Parameters
stream (Stream) fs stream
output (String) output
filename (String) filename
page (Integer) page count
Returns
Promise: Promise

toBase64

GM command - toBase64

toBase64(stream: Stream, filename: String, page: Integer): Promise
Parameters
stream (Stream) fs stream
filename (String) filename
page (Integer) page count
Returns
Promise: Promise

convert

Intialize converter

convert(pdf_path: String, page: Page): Object
Parameters
pdf_path (String) path to file
page (Page = 1) page number to be converted
Returns
Object: image status

convertToBase64

Intialize pdftobase64 converter,

convertToBase64(pdf_path: String, page: Page): Object
Parameters
pdf_path (String) path to file
page (Page = 1) page number to be converted
Returns
Object: image status

convertToBase64Bulk

Intialize pdftobase64 converter, well the bulk version

convertToBase64Bulk(pdf_path: String, pages: Page): Object
Parameters
pdf_path (String) path to file
pages (Page = -1) page number to be converted (-1 for all pages)
Returns
Object: image status

convertBulk

Intialize converter, well the bulk version

convertBulk(pdf_path: String, pages: Page): Object
Parameters
pdf_path (String) path to file
pages (Page = -1) page number to be converted (-1 for all pages)
Returns
Object: image status

getPageCount

Get how many pages are there in the pdf file

getPageCount(pdf_path: String): Integer
Parameters
pdf_path (String) path to file
Returns
Integer: number of pages

getPage

Get pages numbers

getPage(pdf_path: String): Array
Parameters
pdf_path (String) path to file
Returns
Array: pages

toImage

Converts pdf to image

toImage(pdf_path: String, page: Integer): Promise
Parameters
pdf_path (String) pdf path
page (Integer = 1) page count
Returns
Promise: Promise

streamToBase64

Converts pdf to image

streamToBase64(pdf_path: String, page: Integer): Promise
Parameters
pdf_path (String) pdf path
page (Integer = 1) page count
Returns
Promise: Promise

getFilePath

Get file path

getFilePath(stream: Stream): String
Parameters
stream (Stream) fs stream
Returns
String: path

isValidPDF

Checks if the supplied file has the exact file format

isValidPDF(pdf_path: String): Mixed
Parameters
pdf_path (String) path to file
Returns
Mixed: file status

fileExists

Checks if the supplied file has exists

fileExists(pdf_path: String): Mixed
Parameters
pdf_path (String) path to file
Returns
Mixed: file status

getOption

Returns a value from this.options

getOption(key: string): mixed
Parameters
key (string) key from this.options
Returns
mixed: value from this.options

setOption

Set a key-value to this options

setOption(key: any, value: any): object
Parameters
key (any) key from this.options
value (any) value to be assigned on this.options [ key ]
Returns
object: this

pages

not sure yet if this would work

pages