![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A node module that is capable of generating pdf reports from HTML templates.
A node module that is capable of generating pdf reports from HTML templates.
pdf-report
was created out of the need to reliably generate PDF reports based off of templated information. There were many other tools out there that did similar jobs to this but had a poor code base; this tool aims to achieve a better code base and more support.
To install pdf-report
, simply run the following command in your terminal (from your project directory):
npm install pdf-report --save
// external dependencies
const PDFReport = require('pdf-report');
const path = require('path');
const fs = require('fs');
// constants/variables
const html = fs.readFileSync(path.join(__dirname, 'template.html')).toString();
const fileName = path.join(__dirname, 'example.pdf');
// logic
report.toFile(fileName)
.then(function(filePath) {
console.log('open', filePath);
})
.catch(function(error) {
console.log('error', error);
});
{
height: '10.5in',
width: '8in',
orientation: 'portrait',
quality: 75,
timeout: 30000,
assetsDirectory: null,
header: {
height: '26mm'
},
footer: {
height: '18mm'
}
}
After the report has been generated, it can be accessed via one of the following methods:
.toFile(pathToSave)
- generates the report and saves it to disk at the specified path.toBuffer()
- generates the report and returns the buffer.toStream()
- generates the report and returns a read stream to the file<style>
tag in your HTML.<header>
tag in your HTML.<footer>
tag in your HTML.FAQs
A node module that is capable of generating pdf reports from HTML templates.
The npm package pdf-report receives a total of 3 weekly downloads. As such, pdf-report popularity was classified as not popular.
We found that pdf-report demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.