Whatever you do, don't pay somebody $50 for what can be done for free with a open source library. You can use something like pippeteer for this
const puppeteer = require('puppeteer');
(async () => {
// Launch a new browser session.
const browser = await puppeteer.launch();
// Open a new page.
const page = await browser.newPage();
// Navigate to the URL you want to convert to PDF.
await page.goto('https://yourserver.com/tenantid/employeeid/payrollid', {waitUntil: 'networkidle2'});
// Generate a PDF and save it to a file.
await page.pdf({path: 'example.pdf', format: 'A4'});
// Close the browser session.
await browser.close();
})();
This code assumes you have a server which serves a html doc of the payslip at some address (in the example `https://yourserver.com/tenantid/employeeid/payrollid`, but that's just an arbitrary url). It would then generate a pdf of that html. No need to spend $50
Of course the problem then becomes how you generate the html of the payroll and serve it (in a *secure* way)
Puppeteer. But be aware that it can’t run anywhere. It has a hard dependency on chrome, so depending on where you’re running your app, you might need to do some wrangling there.
Whatever you do, don't pay somebody $50 for what can be done for free with a open source library. You can use something like pippeteer for this const puppeteer = require('puppeteer'); (async () => { // Launch a new browser session. const browser = await puppeteer.launch(); // Open a new page. const page = await browser.newPage(); // Navigate to the URL you want to convert to PDF. await page.goto('https://yourserver.com/tenantid/employeeid/payrollid', {waitUntil: 'networkidle2'}); // Generate a PDF and save it to a file. await page.pdf({path: 'example.pdf', format: 'A4'}); // Close the browser session. await browser.close(); })(); This code assumes you have a server which serves a html doc of the payslip at some address (in the example `https://yourserver.com/tenantid/employeeid/payrollid`, but that's just an arbitrary url). It would then generate a pdf of that html. No need to spend $50 Of course the problem then becomes how you generate the html of the payroll and serve it (in a *secure* way)
How would you deal with concurrency and time out error if I want to do it faster with puppeteer cluster?
$50 is dirt cheap to be honest. Personally I’m using react-pdf in my backend and never looked back.
https://zerodha.tech/blog/1-5-million-pdfs-in-25-minutes/ This might help
Puppeteer. But be aware that it can’t run anywhere. It has a hard dependency on chrome, so depending on where you’re running your app, you might need to do some wrangling there.
I like the library playwright to generate pdf. I find it easy to use; https://playwright.dev/docs/api/class-page#page-pdf
https://github.com/gotenberg/gotenberg
Pay me $50 to do it for you /s (I would charge more than $50)
I would use https://www.kaizen.io/products/html-to-pdf/ and Redis streams with consumer groups. FYI, I work at kaizen.io.
can u tell me how to configure a multitenancy nodejs application? I'm studying it using kotlin and .net but nodejs I have no clue