JavaScript perpustakaan ngijini Node.js via .NET gawe Ngonversi PNG gambar gampang. Mesin konversi PNG PNG gambar asli, banjur ngekspor konten grafis gabungan menyang format sing dibutuhake.
PNG bisa uga angel, kajaba sampeyan duwe alat profesional kanggo nindakake tugas kasebut. Gunakake JavaScript kanggo ngowahi PNG kanthi keluwesan lan kacepetan maksimal. Jalanake demo langsung online lan priksa kualitas gambar paling dhuwur ing browser. PNG Conversion API ndhukung akeh opsi migunani.
Ningkatake kapabilitas PNG format gambar Aspose.Words for Node.js via .NET. Iki cara prasaja kanggo gabungke PNG gambar karo JavaScript perpustakaan sing Ngalahake kabeh rincian-tingkat kurang.
Gabung PNG gambar lan simpen asil minangka file siji. Yen sampeyan ngembangake kode ing JavaScript, iki bakal luwih gampang tinimbang sing katon. Deleng JavaScript sing diulang liwat PNG gambar
npm install @aspose/words
Nyalin
const aw = require('@aspose/words');
var fileNames = [ "Input1.png", "Input2.png" ]
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
shapes = fileNames.map(fileName => builder.insertImage(fileName))
// Ngetung jembaré maksimum lan dhuwur lan nganyari setelan kaca
// kanggo potong document pas ukuran gambar.
pageSetup = builder.pageSetup
pageSetup.pageWidth = Math.max(...shapes.map(shape => shape.width));
pageSetup.pageHeight = shapes.reduce((sum, shape) => sum + shape.height, 0);
pageSetup.topMargin = 0
pageSetup.leftMargin = 0
pageSetup.bottomMargin = 0
pageSetup.rightMargin = 0
doc.save("Output.png")
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.
This package is compatible with Node.js 14.17.0 or higher.
Sampeyan bisa nggabungake PNG menyang akeh format file liyane: