כרגע איננו מקבלים קבצי DOCX כקלט. אבל אנחנו יכולים לייצר קבצי DOCX כפלט. אנו מצפים לתמיכה מלאה ב DOCX בעתיד הקרוב.
ספריית C++ היא פתרון עצמאי ואינה דורשת התקנת תוכנת צד שלישי.
הפוך את קובצי ה DOCX לקטנים יותר ללא אובדן איכות. ספריית C++ מספקת למפתחים API משולב לאופטימיזציה של תוכן DOCX. אופטימיזציה של DOCX מתרחשת על ידי דחיסת תמונות בתוך קובצי DOCX, כמו גם על ידי הסרת נתונים שאינם בשימוש.
דחיסה נטולת אובדן של ספרים אלקטרוניים ואופטימיזציה של תוכן קלה עם 'Aspose.Words for C++'. הדוגמה הבאה מדגימה כיצד לבצע אופטימיזציה של התוכן של קובץ DOCX ב C++:
dotnet add package Aspose.Words.Cpp
עותק
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Cleanup();
auto nodes = doc->GetChildNodes(NodeType::Shape, true);
for (const auto& shape : System::IterateOver<Shape>(nodes))
{
if (shape->get_HasImage())
{
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונה.
auto image = System::Drawing::Image::Fromstream(shape->get_ImageData()->ToStream());
// ...
// דחוס תמונה והחזר אותה לצורה.
shape->get_ImageData()->SetImage("yourCompressedImage");
}
}
doc->Save(u"Output.epub");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Cleanup();
auto nodes = doc->GetChildNodes(NodeType::Shape, true);
for (const auto& shape : System::IterateOver<Shape>(nodes))
{
if (shape->get_HasImage())
{
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונה.
auto image =
System::Drawing::Image::FromStream(shape->get_ImageData()->ToStream());
// ...
// דחוס תמונה והחזר אותה לצורה.
shape->get_ImageData()->SetImage("yourCompressedImage");
}
}
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->set_CacheBackgroundGraphics(true);
doc->Save(u"Output.epub", saveOptions);
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Cleanup();
auto nodes = doc->GetChildNodes(NodeType::Shape, true);
for (const auto& shape : System::IterateOver<Shape>(nodes))
{
if (shape->get_HasImage())
{
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונה.
auto image = System::Drawing::Image::Fromstream(shape->get_ImageData()->ToStream());
// ...
// דחוס תמונה והחזר אותה לצורה.
shape->get_ImageData()->SetImage("yourCompressedImage");
}
}
doc->Save(u"Output.epub");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Cleanup();
auto nodes = doc->GetChildNodes(NodeType::Shape, true);
for (const auto& shape : System::IterateOver<Shape>(nodes))
{
if (shape->get_HasImage())
{
// זה תלוי במפתח לבחור את הספרייה לדחיסת תמונה.
auto image =
System::Drawing::Image::FromStream(shape->get_ImageData()->ToStream());
// ...
// דחסו את התמונה והחזירו אותה לצורה.
shape->get_ImageData()->SetImage("yourCompressedImage");
}
}
auto saveOptions = MakeObject<OoxmlSaveOptions>();
saveOptions->set_CompressionLevel(CompressionLevel::Maximum);
doc->Save(u"Output.epub", saveOptions);
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
auto shape = builder->InsertImage(u"Input.docx");
auto saveOptions = MakeObject<ImageSaveOptions>(SaveFormat::Docx);
shape->GetShapeRenderer()->Save(u"Output.epub", saveOptions);
ישנן שלוש אפשרויות להתקנת Aspose.Words for C++ בסביבת המפתחים שלך. אנא בחר אחד שדומה לצרכים שלך ופעל לפי ההוראות המפורטות:
תוכל להשתמש בספריית C++ זו כדי לפתח תוכנות Microsoft Windows, Linux ו- macOS:
אם אתה מפתח תוכנה עבור Linux או macOS, בדוק מידע על תלות בספריות נוספות (חבילות קוד פתוח של fontconfig ו- mesa-glu) בתיעוד המוצר.
אתה יכול לבצע אופטימיזציה של קבצים בפורמטים רבים אחרים של קבצים: