Ngonversi sawetara Word dadi gambar ing JavaScript

Dhuwur-kacepetan Node.js pustaka kanggo nggabungaké file Word menyang gambar

Pustaka Node.js sing cepet lan efisien kanggo nggabungake pirang-pirang file Word dadi gambar. Coba online gratis!

Ndeleng potongan kode

Gabungke Word dadi siji gambar nggunakake JavaScript

Modern JavaScript perpustakaan ngijini Node.js via .NET gawe kanggo nggabungaken Word menyang siji gambar karo sawetara garis saka kode. Mesin konversi Word nganalisa tata letak lan struktur Word konten gabungan menyang gambar format.

Gunakake JavaScript kanggo ngowahi Word dadi gambar kanthi keluwesan lan kacepetan maksimal. Jalanake demo online lan priksa gambar paling dhuwur ing browser. Word Conversion API ndhukung akeh opsi migunani.

Gabungke Word menyang gambar

Kanggo ngowahi sawetara Word menyang gambar mung nggunakake JavaScript sing nangani kabeh rincian tingkat rendah.

Ngonversi pirang-pirang Word lan simpen asil minangka file siji gambar. Yen sampeyan ngembangake kode nggunakake JavaScript, iki bakal luwih gampang tinimbang sing katon. Deleng JavaScript sing ngulang dokumen lan ngowahi dadi gambar format:

Tuladha kode ing JavaScript kanggo nggabungake pirang-pirang DOCX dadi JPG
Unggah file sing pengin digabung
Kode roto
Unggah file sing pengin digabung
Pilih format target saka dhaptar
npm install @aspose/words
Nyalin
const aw = require('@aspose/words');

var fileNames = [ "Input1.docx", "Input2.docx" ]

var output = new aw.Document()
// Mbusak kabeh content saka dokumen tujuan sadurunge nambah.
output.removeAllChildren()

fileNames.forEach(fileName => {
    var input = new aw.Document(fileName);
    // Tambahake dokumen sumber menyang pungkasan dokumen tujuan
    output.appendDocument(input, aw.ImportFormatMode.KeepSourceFormatting);
});

for (var page = 0; page < output.pageCount; page++) {
    var extractedPage = output.extractPages(page, 1);
    extractedPage.save(`Output_${page + 1}.jpg`);
}
Kode roto

Carane ngowahi sawetara Word dadi gambar

  1. Pasang Aspose.Words for Node.js via .NET.
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek JavaScript
  3. Bukak Word berkas JavaScript.
  4. Ngonversi sawetara Word file menyang gambar ing sawetara detik.
  5. Nelpon metode appendDocument(), menehi jeneng file output nganggo ekstensi gambar
  6. Entuk asil konversi Word dadi gambar.

JavaScript kanggo ngowahi Word dadi gambar

We host our Node.js via .Net packages in NPM repositories. Please follow the step-by-step instructions on how to install "Aspose.Words for Node.js via .NET" to your developer environment.

System Requirements

This package is compatible with Node.js 14.17.0 or higher.

Operasi Word Liyane sing Didhukung

Sampeyan bisa nggabungake Word 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.