Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Creates a new PDF document.
Arguments:
Options:
pdf.Font
object being either a AFM font or a OTF fontProperties:
new Date()
) - the date and time the document was createdExample:
const doc = new pdf.Document({
font: new pdf.Font(require('pdfjs/font/helvetica.json')),
padding: 10
})
doc.pipe(fs.createWriteStream('output.pdf'))
// render something onto the document
await doc.end()
For an explanation of the units and different paper sizes have a look at the units section.
Creates a new AFM font pr OTF font object that can be used with PDF documents. TFont objects can be used multiple times.
Arguments:
Available AFM fonts:
pdfjs/font/Courier.json
pdfjs/font/Courier-Bold.json
pdfjs/font/Courier-BoldOblique.json
pdfjs/font/Courier-Oblique.json
pdfjs/font/Helvetica.json
pdfjs/font/Helvetica-Bold.json
pdfjs/font/Helvetica-BoldOblique.json
pdfjs/font/Helvetica-Oblique.json
pdfjs/font/Symbol.json
pdfjs/font/Times.json
pdfjs/font/Times-Bold.json
pdfjs/font/Times-BoldItalic.json
pdfjs/font/Times-Italic.json
pdfjs/font/Times-Roman.json
pdfjs/font/ZapfDingbats.json
Examples:
new pdf.Font(require('pdfjs/font/Helvetica.json'))
new pdf.Font(fs.readFileSync('./opensans/regular.ttf'))
Creates a new image that can be added to one or multiple documents.
Arguments:
Example:
const src = fs.readFileSync('image.jpg')
const img = new pdf.Image(src)
doc.image(img)
Creates a new external PDF document that can be merged into the document or that can be added to the document as a page template.
Arguments:
Example:
const src = fs.readFileSync('other.pdf')
const ext = new pdf.ExternalDocument(src)
doc.setTemplate(ext)
doc.addPagesOf(ext)
doc.addPageOf(1, ext)
PDFs are measured in points (1/72"
), i.e., each point is 1/72
of an inch. That is, the paper size of an US letter is in points 8.5 * 72 = 612
wide and 11 * 72 = 792
high.
The following helper are exported:
pdf.mm
pdf.cm
Example:
{ padding: 15 * pdf.mm }
Paper Sizes:
FAQs
PDF generation library
The npm package jspdf-cry receives a total of 1 weekly downloads. As such, jspdf-cry popularity was classified as not popular.
We found that jspdf-cry 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.