Modern JavaScript perpustakaan ngijini Node.js via .NET gawe Ngonversi TIFF kanggo JPG format gambar karo sawetara garis saka kode. TIFF nganalisa konten grafis asli, lan ngekspor gambar gabungan menyang JPG format.
Gunakake JavaScript kanggo ngowahi TIFF dadi JPG format gambar kanthi keluwesan lan kacepetan maksimal. Jalanake demo langsung online lan priksa JPG paling dhuwur ing browser. TIFF Conversion API ndhukung akeh opsi migunani.
Kanggo ngowahi sawetara TIFF kanggo JPG mung nggunakake JavaScript sing nangani kabeh rincian tingkat rendah.
Ngonversi pirang TIFF lan simpen asil dadi siji JPG gambar Yen sampeyan ngembangake kode ing JavaScript, konversi format gambar bakal luwih gampang tinimbang sing katon. Deleng JavaScript sing ngulang file gambar lan JPG:
npm install @aspose/words
Nyalin
const aw = require('@aspose/words');
var fileNames = [ "Input1.tiff", "Input2.tiff" ]
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.jpg")
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 TIFF menyang akeh format file liyane: