forked from Inkognitoo/Pdf2Png
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Trey Smith
committed
Sep 16, 2021
1 parent
294d9ac
commit d108484
Showing
21 changed files
with
819 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/// <reference types="node" /> | ||
export declare const ghostscriptPath: string; | ||
export default class PDFConvert { | ||
options: any; | ||
source: Buffer | string; | ||
tempLocation: string | undefined; | ||
/** | ||
* Constructs a new Convert Object | ||
* @param source Can be either the buffer of the data, or a web url of the file | ||
* @param options ghostScript Options | ||
*/ | ||
constructor(source: Buffer | string, options?: any); | ||
/** | ||
* Gets the page count of the pdf | ||
* @returns number of pages in the pdf | ||
*/ | ||
getPageCount: () => Promise<number>; | ||
/** | ||
* Writes the source file to a tmp location | ||
* @returns Filename | ||
*/ | ||
private writeFileToTemp; | ||
/** | ||
* Removes the temp file created for the PDF conversion | ||
* This should be called manually in case you want to do multiple operations | ||
*/ | ||
clean: () => Promise<void>; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// <reference types="node" /> | ||
export default class PDFConvert { | ||
options: any; | ||
source: Buffer | string; | ||
tempLocation: string | undefined; | ||
ghostscriptPath: string; | ||
/** | ||
* Constructs a new Convert Object | ||
* @param source Can be either the buffer of the data, or a web url of the file | ||
* @param options ghostScript Options | ||
*/ | ||
constructor(source: Buffer | string, options?: any); | ||
convertPageToImage: (page: number) => Promise<Buffer>; | ||
/** | ||
* Gets the page count of the pdf | ||
* @returns number of pages in the pdf | ||
*/ | ||
getPageCount: () => Promise<number>; | ||
/** | ||
* Writes the source file to a tmp location | ||
* @returns Filename | ||
*/ | ||
private writePDFToTemp; | ||
/** | ||
* Removes the temp file created for the PDF conversion | ||
* This should be called manually in case you want to do multiple operations | ||
*/ | ||
clean: () => Promise<void>; | ||
} |
Oops, something went wrong.