Skip to content

Instantly share code, notes, and snippets.

@groupdocs-com-kb
Last active October 31, 2025 18:14
Show Gist options
  • Save groupdocs-com-kb/985c64d9fb252d3e624a64c286828c41 to your computer and use it in GitHub Desktop.
Save groupdocs-com-kb/985c64d9fb252d3e624a64c286828c41 to your computer and use it in GitHub Desktop.
Render RTF as PDF using Python. For more information, please follow link: https://kb.groupdocs.com/viewer/python/render-rtf-as-pdf-using-python/
import groupdocs.viewer as gv
import groupdocs.viewer.options as gvo
# Load the input RTF document
with gv.Viewer("./input.rtf") as viewer:
# Define view options to export the document as a PDF file
viewOptions = gvo.PdfViewOptions("./output.pdf")
# Render and save the RTF document content into the specified PDF file
viewer.view(viewOptions)
print("RTF document has been successfully rendered to PDF format.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment