Cần phải chuyển đổi một BMP ảnh để PDF tập lập trình? Với Aspose.Words for Node.js via .NET bất kỳ nhà phát triển nào cũng có thể dễ dàng chuyển đổi BMP thành PDF chỉ với một vài dòng mã JavaScript.
Xử lý hình ảnh hiện đại JavaScript API tạo PDF từ BMP với tốc độ cao. Kiểm tra chất lượng của BMP sang PDF ngay trong trình duyệt. JavaScript mạnh mẽ cho phép chuyển đổi BMP sang nhiều định dạng tài liệu phổ biến.
Ví dụ sau minh họa cách chuyển đổi BMP thành PDF trong JavaScript.
Thực hiện theo các bước đơn giản để biến một BMP hình ảnh vào PDF định dạng. Đọc BMP từ ổ đĩa cục bộ, sau đó chỉ cần lưu nó dưới dạng PDF, chỉ định định dạng tài liệu được yêu cầu bằng phần mở rộng PDF Đối với cả cách đọc BMP PDF bạn có thể sử dụng các tên tệp đủ điều kiện. PDF đầu ra sẽ giống với BMP hình ảnh.
npm install @aspose/words
Sao chép
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.
Bạn có thể chuyển đổi BMP sang nhiều định dạng tệp khác: