Skip to content

Instantly share code, notes, and snippets.

View groupdocs-com-kb's full-sized avatar

groupdocs-com-kb

View GitHub Profile
@groupdocs-com-kb
groupdocs-com-kb / Render MHTML as PDF using Python.py
Created September 23, 2025 15:24
Render MHTML as PDF using Python. For more information, please follow link: https://kb.groupdocs.com/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source MHTML file and convert it to PDF
with gv.Viewer("./input.mhtml") as viewer:
# Create a PDF file for the document.
# Specify the PDF file name.
viewOptions = gvo.PdfViewOptions("./output.pdf")
viewer.view(viewOptions)
@groupdocs-com-kb
groupdocs-com-kb / Render CHM as HTML using Python.py
Created September 23, 2025 15:23
Render CHM as HTML using Python. For more information, please follow link: https://kb.groupdocs.com/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
with gv.Viewer("./input.chm") as viewer:
# Convert the CHM file to HTML.
# {0} is replaced with the page numbers in the output file names.
viewOptions = gvo.HtmlViewOptions.for_embedded_resources("./chm_result_{0}.html")
# Enable the following option to display all CHM content on a single HTML page.
# viewOptions.setRenderToSinglePage(true)
viewer.view(viewOptions)
@groupdocs-com-kb
groupdocs-com-kb / Render HTML as JPG using Python.py
Created September 23, 2025 15:20
Render HTML as JPG using Python. For more information, please follow link: https://kb.groupdocs.com/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source HTML file
with gv.Viewer("./input.html") as viewer:
# Create a JPEG image for each drawing page.
# {0} is replaced with the current page number in the image name.
viewOptions = gvo.JpgViewOptions("output_{0}.jpg")
# Set width and height.
viewOptions.width = 1600
@groupdocs-com-kb
groupdocs-com-kb / Render HTML as PNG using Python.py
Created September 23, 2025 15:17
Render HTML as PNG using Python. For more information, please follow link: https://kb.groupdocs.com/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source HTML file
with gv.Viewer("./input.html") as viewer:
# Convert the HTML to PNG
# {0} is replaced with the page numbers in the output image names.
viewOptions = gvo.PngViewOptions("./output_{0}.png")
# Set width and height.
viewOptions.width = 950
@groupdocs-com-kb
groupdocs-com-kb / Render HTML as PDF using Python.py
Created September 23, 2025 15:15
Render HTML as PDF using Python. For more information, please follow link: https://kb.groupdocs.com/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source HTML file and convert it to PDF
with gv.Viewer("./input.html") as viewer:
# Create a PDF file for the document.
# Specify the PDF file name.
viewOptions = gvo.PdfViewOptions("./output.pdf")
viewer.view(viewOptions)
@groupdocs-com-kb
groupdocs-com-kb / Render PPTX as HTML using Python.py
Last active September 21, 2025 14:53
Render PPTX as HTML using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-pptx-as-html-using-python/
# This code converts a PowerPoint file to HTML format
# using GroupDocs.Viewer for Python via .NET.
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source PPTX file and convert it to HTML
with gv.Viewer("./input.pptx") as viewer:
# Create an HTML file for each slide.
# {0} is replaced with the current page number in the file name.
options = gvo.HtmlViewOptions.for_embedded_resources("./page_{0}.html")
@groupdocs-com-kb
groupdocs-com-kb / Render Hidden Slides to PDF using Python.py
Last active September 21, 2025 14:53
Render Hidden Slides to PDF using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-hidden-slides-to-pdf-using-python/
# This code converts a PowerPoint file to PDF
# using GroupDocs.Viewer for Python via .NET.
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source PPTX file and convert it to PDF
with gv.Viewer("./input.pptx") as viewer:
viewOptions = gvo.PdfViewOptions("./output.pdf")
viewOptions.render_hidden_pages = True
viewer.view(viewOptions)
@groupdocs-com-kb
groupdocs-com-kb / Render PPTX as JPG using Python.py
Last active September 21, 2025 14:53
Render PPTX as JPG using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-pptx-as-jpg-using-python/
# Make sure to install the GroupDocs.Viewer for Python via .NET
# and have a valid license.
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source PPTX file and convert it to JPG images
with gv.Viewer("./input.pptx") as viewer:
# Create JPG view options
viewOptions = gvo.JpgViewOptions("./output_{0}.jpg")
# Render the PPTX sheets to JPG images
@groupdocs-com-kb
groupdocs-com-kb / Render PPTX as PNG using Python.py
Last active September 21, 2025 14:53
Render PPTX as PNG using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-pptx-as-png-using-python/
# Make sure to install the GroupDocs.Viewer for Python via .NET
# and have a valid license.
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source PPTX file and convert it to PNG images
with gv.Viewer("./input.pptx") as viewer:
# Create PNG view options
viewOptions = gvo.PngViewOptions("./output_{0}.png")
# Render the PPTX sheets to PNG images
@groupdocs-com-kb
groupdocs-com-kb / Render PPTX as PDF using Python.py
Last active September 21, 2025 14:52
Render PPTX as PDF using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-pptx-as-pdf-using-python/
# This code converts a PowerPoint file to PDF
# using GroupDocs.Viewer for Python via .NET.
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the source PPTX file and convert it to PDF
with gv.Viewer("./input.pptx") as viewer:
viewOptions = gvo.PdfViewOptions("./output.pdf")
viewer.view(viewOptions)