# Render to PDF Rendering files to PDF with GroupDocs.Viewer for Python via .NET. It means that you can embed PDF in websites or applications by using this .NET API When rendering to PDF, GroupDocs.Viewer renders all pages of the source document as a single PDF document. To render files to PDF, follow these steps: 1. Create an instance of the [Viewer](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer/viewer/) class. Specify the source document path as a constructor parameter. 2. Instantiate the [PdfViewOptions](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfviewoptions/) object. Specify a path to save the rendered file. 3. Call the [View.view()](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer/viewer/#methods) method of the [Viewer](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer/viewer/) object. Specify the [PdfViewOptions](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfviewoptions/) object as the parameter. The following code snippet shows how to render a .docx document to PDF: {{< tabs "example1">}} {{< tab "Python" >}} ```python from groupdocs.viewer import Viewer from groupdocs.viewer.options import PdfViewOptions def render_to_pdf(): # Load document with Viewer("sample.docx") as viewer: pdf_options = PdfViewOptions("output-to-pdf.pdf") viewer.view(pdf_options) print(f"\nSource document rendered successfully.") if __name__ == "__main__": render_to_pdf() ``` {{< /tab >}} {{< tab "sample.docx" >}} {{< tab-text >}} `sample.docx` is the sample file used in this example. Click [here](https://docs.groupdocs.com/viewer/python-net/_sample_files/developer-guide/rendering-documents/rendering-to-pdf/sample.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} For details, please refer to the following pages: ## Contents - [Reorder pages](https://docs.groupdocs.com/viewer/python-net/reorder-pages.md) - [Protect PDF document](https://docs.groupdocs.com/viewer/python-net/protect-pdf-documents.md) - [Specify the JPEG image quality](https://docs.groupdocs.com/viewer/python-net/adjust-jpeg-images-quality.md) - [Set image size limits](https://docs.groupdocs.com/viewer/python-net/set-image-size-limits-when-rendering-to-pdf.md) - [Optimize the output PDF file](https://docs.groupdocs.com/viewer/python-net/optimization-pdf-options.md)