Entwickeln Sie EPUB-Verarbeitungssoftware in Node.js mit EPUB Optimization API. Mit dieser leistungsstarken Node.js -Lösung können Sie EPUB Dateien mühelos optimieren und verkleinern. Testen Sie die EPUB-Komprimierungsfunktionen kostenlos online!
Wir akzeptieren derzeit keine DOCX Dateien als Eingabe. Aber wir können DOCX Dateien als Ausgabe erzeugen. Wir freuen uns auf die vollständige DOCX Unterstützung in naher Zukunft.
JavaScript Bibliothek ist eine eigenständige Lösung und erfordert keine installierte Software von Drittanbietern.
Verkleinern Sie DOCX Dateien ohne Qualitätsverlust. Die JavaScript Bibliothek bietet Entwicklern eine integrierte API zur Optimierung von DOCX Inhalten. Die DOCX Optimierung erfolgt durch Komprimieren von Bildern in DOCX Dateien sowie durch Entfernen nicht verwendeter Daten.
Ebook verlustfreie Komprimierung und Inhaltsoptimierung leicht gemacht mit 'Aspose.Words for Node.js via .NET'. Das folgende Beispiel zeigt, wie der Inhalt einer DOCX Datei in JavaScript:
npm install @aspose/words
Kopieren
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()) {
// Es liegt am Entwickler, die Bibliothek für die Bildkomprimierung auszuwählen.
const imageData = shape.getImageData().toStream();
// ...
// Komprimieren Sie das Bild und setzen Sie es wieder auf die Form.
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()) {
// Es liegt am Entwickler, die Bibliothek für die Bildkomprimierung auszuwählen.
const imageData = shape.getImageData().toStream();
// ...
// Komprimieren Sie das Bild und setzen Sie es wieder auf die Form.
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()) {
// Es liegt am Entwickler, die Bibliothek für die Bildkomprimierung auszuwählen.
const imageData = shape.getImageData().toStream();
// ...
// Komprimieren Sie das Bild und setzen Sie es wieder auf die Form.
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()) {
// Es liegt am Entwickler, die Bibliothek für die Bildkomprimierung auszuwählen.
const imageData = shape.getImageData().toStream();
// ...
// Komprimieren Sie das Bild und setzen Sie es wieder auf die Form.
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.
Sie können Dateien in vielen anderen Dateiformaten optimieren: