Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Setting a print area in a document helps control printed content. Key reasons include:
To set a print area programmatically:
# Sample image reference remains unchanged
<img src="3.png" width=60% />
To remove print area constraints:
# Sample image reference remains unchanged
<img src="4.png" width=60% />
Clearing the print area results in:
Set print area through worksheet’s page setup:
import aspose.cells as ac
# Load sample workbook
workbook = ac.Workbook("input.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Set print area to A1:D10
worksheet.page_setup.print_area = "A1:D10"
# Save modified workbook
workbook.save("output_set_print_area.xlsx")
# Output image reference
<img src="1.png" width=60% />
Remove existing print area definition:
import aspose.cells as ac
# Load sample workbook
workbook = ac.Workbook("input.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Clear print area
worksheet.page_setup.print_area = ""
# Save modified workbook
workbook.save("output_clear_print_area.xlsx")
# Output image reference
<img src="2.png" width=60% />
from aspose.cells import Workbook
# Load the workbook
workbook = Workbook("input.xlsx")
# Access the desired worksheet
worksheet = workbook.worksheets[0]
# Set the print area - specify the range you want to print
worksheet.page_setup.print_area = "A1:D10"
# Save the workbook
workbook.save("set_print_area.pdf")
from aspose.cells import Workbook
# Load the workbook
workbook = Workbook("input.xlsx")
# Access the desired worksheet
worksheet = workbook.worksheets[0]
# Clear the print area
worksheet.page_setup.print_area = ""
# Save the workbook
workbook.save("clear_print_area.pdf")
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.