Come convertire HTML in PDF con Node.js tramite C++

Panoramica

Aspose.Cells is a professional solution that allows you to generate PDF files from web pages and raw HTML code in your applications.

This article explains how to converti HTML in PDF. It covers the following topics.

Conversione HTML in PDF in Node.js

Come convertire HTML in PDF? Con la libreria Aspose.Cells for Node.js via C++ puoi facilmente convertire HTML in PDF tramite pochi righi di codice. Aspose.Cells for Node.js via C++ è in grado di creare applicazioni multipiattaforma con capacità di generare, modificare, convertire, renderizzare e stampare tutti i file Excel.

JavaScript Converti HTML in PDF

Il seguente esempio di codice JavaScript mostra come convertire un documento HTML in PDF usando Aspose.Cells for Node.js via C++.

  1. Crea un’istanza della classe HtmlLoadOptions.
  2. Inizializza l’oggetto Workbook.
  3. Salvare il documento PDF di output chiamando il metodo Workbook.save().
const AsposeCells = require("aspose.cells.node");
const path = require("path");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.html");

// Loads the workbook which contains hidden external links
const options = new AsposeCells.HtmlLoadOptions(AsposeCells.LoadFormat.Html);
const book = new AsposeCells.Workbook(filePath, options);
book.save("out.pdf");

Prova a convertire HTML in PDF online

Aspose.Cells for Node.js via C++ presents you online free application “HTML to PDF”, where you may try to investigate the functionality and quality it works.