Razvijte softver za obradu EPUB u Node.js koristeći EPUB Optimization API. Ovo moćno Node.js rješenje pomaže vam optimizirati i smanjiti veličinu EPUB datoteka bez napora. Isprobajte EPUB mogućnosti kompresije online besplatno!
Trenutačno ne prihvaćamo DOCX datoteke kao ulaz. Ali možemo proizvesti DOCX datoteke kao izlaz. Radujemo se punoj podršci za DOCX u bliskoj budućnosti.
JavaScript knjižnica je samostalno rješenje i ne zahtijeva instaliran softver treće strane.
Smanjite DOCX datoteke bez gubitka kvalitete. JavaScript biblioteka razvojnim programerima pruža integrirani API za optimizaciju DOCX sadržaja. DOCX optimizacija se događa kompresijom slika unutar DOCX datoteka, kao i uklanjanjem neiskorištenih podataka.
Kompresija e-knjiga bez gubitaka i optimizacija sadržaja olakšani uz 'Aspose.Words for Node.js via .NET'. Sljedeći primjer pokazuje kako optimizirati sadržaj DOCX datoteke u JavaScript:
npm install @aspose/words
Kopirati
const aw = require('@aspose/words');
var doc = new aw.Document("Input.docx");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Izbor knjižnice za komprimiranje slika prepušten je programeru.
const imageData = shape.getImageData().toStream();
// ...
// Stisnite sliku i vratite je u prethodni oblik.
shape.getImageData().setImage(compressedImageBuffer);
}
}
doc.save("Output.epub")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.docx");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Izbor knjižnice za komprimiranje slika prepušten je programeru.
const imageData = shape.getImageData().toStream();
// ...
// Stisnite sliku i vratite je u prethodni oblik.
shape.getImageData().setImage(compressedImageBuffer);
}
}
var saveOptions = new aw.Saving.PdfSaveOptions()
saveOptions.cacheBackgroundGraphics = true
doc.save("Output.epub", saveOptions)
const aw = require('@aspose/words');
var doc = new aw.Document("Input.docx");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Izbor knjižnice za komprimiranje slika prepušten je programeru.
const imageData = shape.getImageData().toStream();
// ...
// Stisnite sliku i vratite je u prethodni oblik.
shape.getImageData().setImage(compressedImageBuffer);
}
}
doc.save("Output.epub")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.docx");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Izbor knjižnice za komprimiranje slika prepušten je programeru.
const imageData = shape.getImageData().toStream();
// ...
// Stisnite sliku i vratite je u prethodni oblik.
shape.getImageData().setImage(compressedImageBuffer);
}
}
var saveOptions = new aw.Saving.OoxmlSaveOptions()
saveOptions.compressionLevel = aw.Saving.CompressionLevel.Maximum
doc.save("Output.epub", saveOptions)
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
shape = builder.insertImage("Input.docx")
var saveOptions = new aw.Saving.ImageSaveOptions(aw.SaveFormat.Docx)
shape.getShapeRenderer().save("Output.epub", saveOptions)
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.
Možete optimizirati datoteke u mnogim drugim formatima datoteka: