จำเป็นที่จะต้องแปลง BMP ภาพเพื่อ PDF ไฟล์โปรแกรม? ด้วย Aspose.Words for Node.js via .NET พัฒนาใด ๆ สามารถแปลง BMP เข้า PDF รูปแบบที่มีเพียงไม่กี่บรรทัดของ JavaScript รหัส
การประมวลผลภาพสมัยใหม่ JavaScript API สร้าง PDF จาก BMP ภาพด้วยความเร็วสูง ทดสอบคุณภาพของ BMP ถึง PDF ในเบราว์เซอร์ JavaScript อันทรงพลังช่วยให้แปลง BMP เป็นรูปแบบเอกสารยอดนิยมมากมาย
ตัวอย่างต่อไปนี้สาธิตวิธีการแปลง BMP เป็น PDF ใน JavaScript.
ทำตามขั้นตอนง่ายๆที่จะเปิด BMP ภาพเป็น PDF รูปแบบ อ่าน BMP จากโลคัลไดรฟ์ จากนั้นบันทึกเป็น PDF โดยระบุรูปแบบเอกสารที่ต้องการโดยส่วนขยาย PDF สำหรับทั้ง BMP การอ่านและการ PDF เขียนคุณสามารถใช้ชื่อไฟล์ที่มีคุณสมบัติครบถ้วน PDF จะเหมือนกับรูปภาพ BMP.
npm install @aspose/words
สำเนา
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
builder.insertImage("Input.bmp")
doc.save("Output.pdf")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.bmp")
doc.save("Output.pdf")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.bmp")
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.bmp")
doc.save("Output.pdf")
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
shape = builder.insertImage("Input.bmp")
shape.getShapeRenderer().save("Output.pdf", new aw.Saving.ImageSaveOptions(aw.SaveFormat.pdf))
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.
คุณสามารถแปลง BMP เป็นรูปแบบไฟล์อื่นๆ ได้มากมาย: