1.0.5 • Published 11 months ago

node-ts-pdf v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

node-ts-pdf

A simple html template to base64 converter package, beautifully designed & well maintained.

Will use in node.js OR node with typescript backend.

Installation

Install node-ts-pdf with npm

  npm install node-ts-pdf

Usage/Examples

import { html_to_base64 } from 'node-ts-pdf/lib/add';


async function App() {
  const base64_result = await html_to_base64(`YOUR_HTML_TEMPLATE`, false);
  console.log('get base64 result :=', base64_result);
  return base64_result;
}

Implementation using optional parameters

async function App() {
  const base64_result = await html_to_base64(`YOUR_HTML_TEMPLATE`, false, 595, 842, 2);
  console.log('get base64 result :=', base64_result);
  return base64_result;
}

Parameters

ParameterTypeDescription
printBackgroundbooleanRequired. Pass this parameter true/false for printing the background
vw_widthnumberOptional. Adjust the A4 paper width in pixels. Default: 595
vw_heightnumberOptional. Adjust the A4 paper height in pixels Default: 842
deviceScaleFactornumberOptional. Adjust the scale factor if needed. Default: 2

Authors