לפתח EPUB תוכנת עיבוד ב Node.js באמצעות EPUB Optimization API. פתרון Node.js רב עוצמה זה עוזר לך לייעל ולהקטין את הגודל של EPUB קבצים ללא מאמץ. מבחן EPUB דחיסת יכולות באינטרנט בחינם!
כרגע איננו מקבלים קבצי DOCX כקלט. אבל אנחנו יכולים לייצר קבצי DOCX כפלט. אנו מצפים לתמיכה מלאה ב DOCX בעתיד הקרוב.
ספריית JavaScript היא פתרון עצמאי ואינה דורשת התקנת תוכנת צד שלישי.
הפוך את קובצי ה DOCX לקטנים יותר ללא אובדן איכות. ספריית JavaScript מספקת למפתחים API משולב לאופטימיזציה של תוכן DOCX. אופטימיזציה של DOCX מתרחשת על ידי דחיסת תמונות בתוך קובצי DOCX, כמו גם על ידי הסרת נתונים שאינם בשימוש.
דחיסה נטולת אובדן של ספרים אלקטרוניים ואופטימיזציה של תוכן קלה עם 'Aspose.Words for Node.js via .NET'. הדוגמה הבאה מדגימה כיצד לבצע אופטימיזציה של התוכן של קובץ DOCX ב JavaScript:
npm install @aspose/words
עותק
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()) {
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונות.
const imageData = shape.getImageData().toStream();
// ...
// לדחוס תמונה ולהגדיר אותו בחזרה לצורה.
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()) {
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונות.
const imageData = shape.getImageData().toStream();
// ...
// לדחוס תמונה ולהגדיר אותו בחזרה לצורה.
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()) {
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונות.
const imageData = shape.getImageData().toStream();
// ...
// לדחוס תמונה ולהגדיר אותו בחזרה לצורה.
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()) {
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונות.
const imageData = shape.getImageData().toStream();
// ...
// לדחוס תמונה ולהגדיר אותו בחזרה לצורה.
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.
אתה יכול לבצע אופטימיזציה של קבצים בפורמטים רבים אחרים של קבצים: