Ngonversi Word, PDF, dokumen Web ing JavaScript

Dhuwur-kacepetan Node.js perpustakaan kanggo ngowahi dokumen kanggo macem-macem format file

Program ngowahi dokumen nggunakake Node.js. Jelajahi daya Node.js kanggo konversi format file sing efisien lan bisa diukur.

Ndeleng potongan kode

Ngonversi dokumen antarane macem-macem format nggunakake JavaScript

Apa sampeyan kudu ngowahi dokumen saka siji format menyang format liyane kanthi program? Kanthi Aspose.Words kanggo Node.js via .NET sampeyan bisa ngowahi file nggunakake mung sawetara baris JavaScript kode.

Node.js via .NET kuat ngidini ngowahi dokumen menyang akeh format populer kanthi kualitas profesional:

  • Microsoft Word: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM
  • OpenOffice: ODT, OTT
  • Tata letak tetep: PDF, XPS, OpenXPS, PostScript
  • Gambar: JPG, PNG, TIFF, BMP, SVG, EMF, GIF
  • Web: HTML, MHTML
  • Liyane: EPUB, MOBI, Xaml, PCL, lsp.

Conto ing ngisor iki nuduhake carane ngowahi dokumen ing JavaScript. Muat file saka drive lokal, banjur simpen, nemtokake format file sing dibutuhake ing ekstensi. Kanggo file input lan output sampeyan bisa nggunakake jeneng file sing mumpuni. Isi lan format output bakal padha karo dokumen asli.

Conto kode ing JavaScript kanggo ngowahi format dokumen
Unggah file sing pengin diowahi
Kode roto
Pilih format target saka dhaptar
npm install @aspose/words
Nyalin
const aw = require('@aspose/words');

var doc = new aw.Document("Input.docx")
doc.save("Output.pdf")
const aw = require('@aspose/words'); var doc = new aw.Document("Input.docx") doc.save("Output.pdf") const aw = require('@aspose/words'); var doc = new aw.Document("Input.docx") for (var page = 0; page < doc.pageCount; page++) { var extractedPage = doc.extractPages(page, 1); extractedPage.save(`Output_${page + 1}.pdf`); } const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) builder.insertImage("Input.docx") doc.save("Output.pdf") const aw = require('@aspose/words'); var doc = new aw.Document() var builder = new aw.DocumentBuilder(doc) shape = builder.insertImage("Input.docx") shape.getShapeRenderer().save("Output.pdf", new aw.Saving.ImageSaveOptions(aw.SaveFormat.pdf))
Kode roto
Nuduhake kode ing media sosial:

Carane ngowahi PDF, Word, JPG lan format file liyane ing JavaScript

  1. Pasang Aspose.Words for Node.js via .NET.
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek JavaScript.
  3. Bukak file sumber ing JavaScript.
  4. Nelpon metode save(), ngliwati jeneng file output kanthi ekstensi sing dibutuhake.
  5. Entuk asil konversi minangka file sing kapisah.

JavaScript perpustakaan kanggo ngowahi file

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.

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.