Optimize spreadsheets in a PDF file
Leave feedback
On this page
This optimization allows to reduce the output file size by setting up border lines. Besides that, it removes the Arial and Times New Roman characters of 32-127 codes.
The default value is False.
The following code snippet shows how to optimize spreadsheets in a PDF file:
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import PdfViewOptions, PdfOptimizationOptions
def optimize_spreadsheets():
# Load spreadsheet
with Viewer("invoice.xlsx") as viewer:
viewOptions = PdfViewOptions("optimize_spreadsheets/optimized_spreadsheet.pdf")
viewOptions.pdf_optimization_options = PdfOptimizationOptions()
viewOptions.pdf_optimization_options.optimize_spreadsheets = True
viewer.view(viewOptions)
if __name__ == "__main__":
optimize_spreadsheets()
invoice.xlsx is the sample file used in this example. Click here to download it.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.