0.1.6 • Published 12 months ago

node-pdf-lfs v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

NODE-PDF-LFS

Who is this package going help ?

  • To all the people who generat large amounts of HTML reports for any sort of execution / Process and want to convert them to PDF's due to requirements.
  • This can help you generate PDF's from your existing HTML REPORTS, I did bench-marks with 25000 pages of PDF conversion : Say a 400 MB HTML to PDF took about ~45 Mins
  • Yes < 5000 pages, you have it in less than ~5 mins, More the pages more the time. But let's assume your max cap is going to be 1 hr MAX

What issue does this solve ?

  • Chrome is our goto tool to generate PDF's atleast from HTML's, But when our size of HTML gets larger we end up facing issues
  • So here we follow a DIVIDE AND CONQUER method to get things done.

What's Special ?

  • Define what contents you expect in a A4-Size page of your report and split them with the tags
    <page></page>                       <!-- This defines your page split -->
    <globalsettings></globalsettings>   <!-- Defines what should be repeated in each page / HTML buffer -->
  • Supports CSS3, No matter how heavy your CSS is, The package handles it for you (Maybe try adjusting the variable --min-page-buffer if it's too heavy

Let's Get Started

Installation

NOTE

Always perform this in a empty directory. 
This is a standalone package, Not a dependancy (Atleast for now)
npm i node-pdf-lfs

PARAMETERS YOU CAN CONTROL

CMD PARAMETERVALUE IN SCRIPTDETAIL
--template-fileTEMPLATE_FILEFile to be treated for indexing with <page></page> and <globalsettings></globalsettings>
--result-rootRESULT_ROOTLocation of storing the final PDF after completing the MERGE : default name -> temp-1.pdf
--asset-rootASSET_ROOTLocation where the TEMPLATE HTML file should look for assets
--temp-rootTEMP_ROOTLocation where the temporary template html's will be stored
--min-page-bufferMIN_PAGE_BUFFERThe minimum pages that are indexed using <page></page> should be included in a file
--verboseDEBUG_FLAGDisplays all console.debug() logs for debugging purposes of indexing

Example

Sample execution call with all parameters

node . --verbose --result-root="" --assset-root="" --temp-root="" --template-file="" --min-page-buffer=50

Bench Marks

imageimage

If you like the project a ⭐ to the REPO would mean a lot. ❤

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago