New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

spi-pdf

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

spi-pdf

Creador de PDF a apartir de un html y variables

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Requeriments

sudo apt install libcairo2 sudo apt install libpango-1.0-0 sudo apt install libxkbcommon0 sudo apt install libgbm1 sudo apt install libxdamage1

Quick start

Create a fille:

<html>

<head>
    <title>HTML content</title>
</head>

<body>
    <h1>Sample</h1>
    <div>
        <p>
            This is my file {{myVariable}}
        </p>
</body>

</html>
const { PDF } = require("@spi/pdf");

const file = './my-document.html'

const pdf = PDF.fromPath(file, {
    myVar: 'Amazing file'
});

pdf.store(process.cwd() + '/salud/documentos/encuesta.pdf'); // will store a pdf file

pdf.toResponse(process.cwd() + '/newFile.pdf'); // will generate a base64 string

pdf.toBase64() // Will generate base64 string

FAQs

Package last updated on 07 May 2024

Related posts