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