DOC Optimization API kullanarak Node.js 'de DOC işleme yazılımı geliştirin. Bu güçlü Node.js çözüm, DOC dosyaların boyutunu zahmetsizce optimize etmenize ve azaltmanıza yardımcı olur. DOC sıkıştırma yeteneklerini çevrimiçi olarak ücretsiz olarak test edin!
Büyük DOC dosyalarını kalite kaybı olmadan küçültün. Gereksiz ve kullanılmayan verileri silin. Kodda bir DOC dosyasının boyutunu küçültün. JavaScript kitaplığı, geliştiricilere DOC içeriğini optimize etmek için entegre bir API sağlar.
JavaScript kitaplığı bağımsız bir çözümdür ve herhangi bir üçüncü taraf yazılımının yüklenmesini gerektirmez.
'Aspose.Words for Node.js via .NET' ile kayıpsız sıkıştırma ve derin içerik optimizasyonu kolaylaştı. Aşağıdaki örnek, JavaScript içindeki bir JavaScript DOC dosyasının içeriğinin nasıl optimize edileceğini gösterir:
npm install @aspose/words
Kopyala
const aw = require('@aspose/words');
var doc = new aw.Document("Input.doc");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Görüntü sıkıştırması için kütüphaneyi seçmek geliştiriciye kalmıştır.
const imageData = shape.getImageData().toStream();
// ...
// Görüntüyü sıkıştırın ve şekle geri ayarlayın.
shape.getImageData().setImage(compressedImageBuffer);
}
}
doc.save("Output.doc")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.doc");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Görüntü sıkıştırması için kütüphaneyi seçmek geliştiriciye kalmıştır.
const imageData = shape.getImageData().toStream();
// ...
// Görüntüyü sıkıştırın ve şekle geri ayarlayın.
shape.getImageData().setImage(compressedImageBuffer);
}
}
var saveOptions = new aw.Saving.PdfSaveOptions()
saveOptions.cacheBackgroundGraphics = true
doc.save("Output.doc", saveOptions)
const aw = require('@aspose/words');
var doc = new aw.Document("Input.doc");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Görüntü sıkıştırması için kütüphaneyi seçmek geliştiriciye kalmıştır.
const imageData = shape.getImageData().toStream();
// ...
// Görüntüyü sıkıştırın ve şekle geri ayarlayın.
shape.getImageData().setImage(compressedImageBuffer);
}
}
doc.save("Output.doc")
const aw = require('@aspose/words');
var doc = new aw.Document("Input.doc");
doc.cleanup();
var shapes = doc.getChildNodes(aw.NodeType.Shape, true)
for (var shape of shapes) {
if (shape.hasImage()) {
// Görüntü sıkıştırması için kütüphaneyi seçmek geliştiriciye kalmıştır.
const imageData = shape.getImageData().toStream();
// ...
// Görüntüyü sıkıştırın ve şekle geri ayarlayın.
shape.getImageData().setImage(compressedImageBuffer);
}
}
var saveOptions = new aw.Saving.OoxmlSaveOptions()
saveOptions.compressionLevel = aw.Saving.CompressionLevel.Maximum
doc.save("Output.doc", saveOptions)
const aw = require('@aspose/words');
var doc = new aw.Document()
var builder = new aw.DocumentBuilder(doc)
shape = builder.insertImage("Input.doc")
var saveOptions = new aw.Saving.ImageSaveOptions(aw.SaveFormat.Doc)
shape.getShapeRenderer().save("Output.doc", 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.
Dosyaları diğer birçok dosya biçiminde optimize edebilirsiniz: