JavaScript API kanggo ngowahi HTML dadi PDF

Pustaka JavaScript kanggo ngowahi HTML dadi PDF

Gunakake HTML Conversion REST API kanggo nggawe alur kerja dokumen sing disesuaikan ing JavaScript. Iki minangka solusi profesional kanggo ngowahi HTML dadi PDF lan format dokumen liyane kanthi online nggunakake JavaScript.

Ndeleng potongan kode

Ngonversi HTML menyang PDF JavaScript REST API

Ngonversi file HTML menyang format PDF ing JavaScript. Pustaka JavaScript iki dirancang kanggo ngowahi file HTML menyang macem-macem format file nggunakake REST API.

Konversi API HTML menyang PDF ngidini pangembang JavaScript ngonversi HTML dadi PDF kanthi gampang lan njupuk kauntungan saka loro format file kasebut.

Ngonversi file HTML menyang PDF ing JavaScript

Ngonversi format file saka HTML menyang PDF minangka tugas sing rumit. Kabeh transisi format HTML menyang PDF ditindakake dening JavaScript SDK, nalika njaga isi struktural lan logis utama dokumen HTML sumber.

Pustaka JavaScript minangka solusi profesional kanggo ngowahi file HTML, PDF kanthi online. Cloud SDK iki menehi JavaScript pangembang fungsi kuat lan output PDF kualitas sampurna.

Conto JavaScript ing ngisor iki nggunakake API Konversi bakal miwiti kanthi cepet.

Unggah file sing pengin diowahi
Kode roto
Pilih format target saka dhaptar
import * as fs from "fs";

const wordsApi = new WordsApi("####-####-####-####-####", "##################");

const doc = fs.createReadStream("Input.html");
const request = new model.ConvertDocumentRequest({
    document: doc,
    format: "pdf"
});

const convert = wordsApi.convertDocument(request)
.then((convertDocumentResult) => {
    console.log("Result of ConvertDocument: ", convertDocumentResult);
});
Kode roto
  
Nyalin kode JavaScript menyang clipboard

Carane nggunakake API kanggo ngowahi HTML dadi PDF

  1. Instal perpustakaan JavaScript lan tambahake referensi (ngimpor perpustakaan) menyang proyek sampeyan.
  2. Bukak HTML berkas sumber ing JavaScript.
  3. Telpon metode convertDocument(), ngliwati HTML file lan opsi PDF.
  4. Simpen asil konversi minangka PDF file.

Pustaka JavaScript kanggo ngowahi HTML dadi PDF

Instal 'Aspose.Words Cloud SDK for Node.js' nggunakake manajer paket NPM. npm install asposewordscloud --save saka baris perintah kanggo nginstal SDK liwat manajer paket NPM. Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for Node.js saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

  • @types/request (version 2.48.3+)
  • lodash (version 4.17.15+)
  • lodash.template (version 4.5.0+)
  • request (version 2.88.0+)
  • request-debug (version 0.2.0+)

Deleng Repository Documentation kanggo ndeleng rincian liyane.

Konversi HTML liyane sing didhukung

Sampeyan bisa ngowahi HTML menyang akeh format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.