Convert a Document to Excel

وإحالة الوثائق من شكل إلى آخر هي السمة الرئيسية في هذا الصدد Aspose.Words. يمكنك تحويل الوثائق في أي مكان متاح الشكل أيضاً إلى استمارة XLSX.

Convert a Document to XLSX

تحويل وثيقة إلى XLSX عملية معقدة إلى حد ما. لتحتفظ بوثيقتك على شكل “إكس إل إس إكس” <span notrans="<span notrans=" Aspose.Words"="">" استخدام XlsxSaveOptions الصف الجديد Xlsx العنصر في SaveFormat العد كما ذُكر أعلاه، يمكنكم أن تُنقذوا الوثيقة في أي شكل من أشكال الحمولة تدعمه Aspose.Words إلى XLSX.

The following code example shows how to save PDF to XLSX:

Document doc = new Document(getMyDir() + "Pdf Document.pdf");
doc.save(getArtifactsDir() + "BaseConversions.PdfToXlsx.xlsx");

البحث والاستبدال عندما ينقذون XLSX

أيضاً Aspose.Words, يمكنك العثور على خيط محدد أو تعبير منتظم في وثيقتك واستبداله مع واحد مطابق تحتاج. ثم يمكنك أيضاً أن تنقذ النتيجة إلى “إكس إل إس إكس”

The following code example shows how to perform find and replace operation and save result to XLSX:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.writeln("Ruby bought a ruby necklace.");

// We can use a "FindReplaceOptions" object to modify the find-and-replace process.
FindReplaceOptions options = new FindReplaceOptions();
// Set the "MatchCase" flag to "true" to apply case sensitivity while finding strings to replace.
// Set the "MatchCase" flag to "false" to ignore character case while searching for text to replace.
options.setMatchCase(true);

doc.getRange().replace("Ruby", "Jade", options);
doc.save(getArtifactsDir() + "BaseConversions.FindReplaceXlsx.xlsx");

تحديد مستوى الضغط عند الانتقال إلى XLSX

يمكنك أيضا تحديد مستوى الضغط عند الادخار باستخدام CompressionLevel ملكية

The following code example shows how to specify the compression level whenving to XLSX format:

Document doc = new Document(getMyDir() + "Document.docx");
XlsxSaveOptions saveOptions = new XlsxSaveOptions();
saveOptions.setCompressionLevel(CompressionLevel.MAXIMUM);

doc.save(getArtifactsDir() + "BaseConversions.CompressXlsx.xlsx", saveOptions);

انظر أيضا