Last active
October 31, 2025 18:14
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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