Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
تبدیل اسناد از یک فرمت به فرمت دیگر از ویژگی های شاخص Aspose.Words است. می توانید اسناد را در هر فرمت بارگذاری موجود نیز به فرمت XLSX تبدیل کنید.
تبدیل یک سند به XLSX یک فرآیند نسبتاً پیچیده است. برای ذخیره سند خود در قالب XLSX با استفاده از Aspose.Words، از کلاس XlsxSaveOptions و عنصر Xlsx جدید در شمارش SaveFormat استفاده کنید. همانطور که در بالا ذکر شد، می توانید سند را در هر فرمت بارگیری که توسط Aspose.Words پشتیبانی می شود در XLSX ذخیره کنید.
مثال کد زیر نحوه ذخیره PDF در XLSX را نشان می دهد:
doc = aw.Document(docs_base.my_dir + "Pdf Document.pdf")
doc.save(docs_base.artifacts_dir + "BaseConversions.PdfToXlsx.xlsx")همچنین با استفاده از Aspose.Words، میتوانید یک رشته یا عبارت معمولی را در سند خود پیدا کنید و آن را با عبارت مورد نیاز خود جایگزین کنید. سپس می توانید نتیجه را در قالب XLSX نیز ذخیره کنید.
مثال کد زیر نحوه انجام عملیات Find و جایگزینی و ذخیره نتیجه در XLSX را نشان می دهد:
from aspose.words import Document, DocumentBuilder
from aspose.words.replacing import FindReplaceOptions
doc = Document()
builder = DocumentBuilder(doc)
builder.writeln("Ruby bought a ruby necklace.")
# We can use a "FindReplaceOptions" object to modify the find - and -replace process.
options = FindReplaceOptions()
# Set the "match_case" flag to "True" to apply case sensitivity while finding strings to replace.
# Set the "match_case" flag to "False" to ignore character case while searching for text to replace.
options.match_case = True
doc.range.replace("Ruby", "Jade", options)
doc.save(ARTIFACTS_DIR + "BaseConversions.FindReplaceXlsx.xlsx")همچنین می توانید سطح فشرده سازی را هنگام ذخیره با استفاده از ویژگی CompressionLevel مشخص کنید.
مثال کد زیر نحوه تعیین سطح فشرده سازی هنگام ذخیره در فرمت XLSX را نشان می دهد:
from aspose.words import Document
from aspose.words.saving import XlsxSaveOptions, CompressionLevel
doc = Document(MY_DIR + "Document.docx")
saveOptions = XlsxSaveOptions()
saveOptions.compression_level = CompressionLevel.MAXIMUM
doc.save(ARTIFACTS_DIR + "BaseConversions.CompressXlsx.xlsx", saveOptions)Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.