We are pleased to announce the release of GroupDocs.Viewer for Python via .NET 24.7 (Win x64). This version delivers a significant upgrade for developers and lets them utilize all supported file formats, eliminating previous limitations, and introducing other valuable features and enhancements.
Based on the user feedback, we have lifted file format restrictions in the latest release, allowing you to unleash the document viewing power of your apps. Now, the Python document viewer API supports all file formats documented for the product, which enables you to view a comprehensive range of document types within your Python applications running on Windows x64.
Refined Excel Rendering
This release introduces the ability to render Excel spreadsheets with precise control over page breaks and print areas. This functionality mirrors the printing features in Excel, allowing you to split the printable area into distinct pages based on included page breaks. To achieve this, call the SpreadsheetOptions.ForRenderingPrintAreaAndPageBreaks
method, as illustrated in the following code example.
# render spreadsheet into PDF
with gv.Viewer("products.xlsx") as viewer:
viewOptions = gvo.PdfViewOptions("output.pdf")
viewOptions.spreadsheet_options = gvo.SpreadsheetOptions.for_rendering_print_area_and_page_breaks()
viewer.view(viewOptions)
# render spreadsheet into HTML
with gv.Viewer("products.xlsx") as viewer:
viewOptions = gvo.HtmlViewOptions.for_embedded_resources("page_{0}.html")
viewOptions.spreadsheet_options = gvo.SpreadsheetOptions.for_rendering_print_area_and_page_breaks()
viewer.view(viewOptions)
Source*
Skip Loading of External Resources
We have now added the SkipExternalResources
and WhitelistedResources
properties within the LoadOptions
class. These options empower you to optimize performance and security. You can skip downloading all external resources or selectively skip them within your Windows x64-powered Python apps.
Skip all external resources:
load_options = gvo.LoadOptions()
load_options.skip_external_resources = True # Skip loading of external resources
with gv.Viewer("business-flyer.docx", load_options) as viewer:
viewOptions = gvo.HtmlViewOptions.for_embedded_resources()
viewer.view(viewOptions)
Source*
Select which external resources to skip:
load_options = gvo.LoadOptions()
load_options.skip_external_resources = True # Skip loading of external resources
load_options.white_listed_resources.add("avatars.githubusercontent.com") # Enable loading of external resources that has 'avatars.githubusercontent.com' fragment in resource URL.
with gv.Viewer("business-flyer.docx", load_options) as viewer:
viewOptions = gvo.HtmlViewOptions.for_embedded_resources()
viewer.view(viewOptions)
Source*
Reading License from Embedded Resources
Leverage embedded license support for a more simplified licensing experience. GroupDocs.Viewer for Python via .NET 24.7 lets you specify the license name within your project, and ensure the license file is included as an embedded resource in your Windows 64-bit applications. This code example highlights how to use this feature in Python.
# set license from embedded resource
license = gv.License()
license.set_license("GroupDocs.Viewer.lic")
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Viewer for Python via .NET 24.7 Release Notes.