Reikia programiškai konvertuoti GIF vaizdus į Word? Naudodami Aspose.Words, skirtą Node.js via .NET, galite konvertuoti GIF į Word dokumento formatą naudodami tik kelias JavaScript kodo eilutes.
Mūsų JavaScript API sukuria Word dokumentą iš GIF vaizdų. Išbandykite aukščiausios kokybės GIF Word savo naršyklėje. Galinga Node.js via .NET konvertavimo API leidžia GIF vaizdus konvertuoti į beveik visus Word formatus.
Šiame pavyzdyje parodyta, kaip konvertuoti GIF į Word dokumento formatą JavaScript.
Norėdami paversti GIF vaizdą į Word dokumento formatą, atlikite paprastus veiksmus. Perskaitykite GIF failą iš vietinio disko, tada tiesiog išsaugokite jį dokumento formatu, nurodydami reikiamą failo formatą naudodami " Word dokumento plėtinį. Tiek GIF skaitymui, tiek Word dokumentų rašymui galite naudoti visiškai tinkamus failų pavadinimus.
npm install @aspose/words
Kopijuoti
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
builder.insertImage("Input.gif")
doc.save("Output.docx")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.gif")
doc.save("Output.docx")
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}.docx`);
}
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
builder.insertImage("Input.gif")
doc.save("Output.docx")
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.docx", new aw.Saving.ImageSaveOptions(aw.SaveFormat.docx))
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.