You can load a document from a local disk using a path to a file. GroupDocs.Viewer opens the file in the read-only mode.
The following code snippet shows how to load a document using the local path string:
fromgroupdocs.viewerimportViewerfromgroupdocs.viewer.optionsimportHtmlViewOptionsdefload_document_from_local_disk():# Load document from local diskwithViewer("sample.docx")asviewer:html_options=HtmlViewOptions.for_embedded_resources("load_document_from_local_disk/document_from_local_disk_{0}.html")viewer.view(html_options)if__name__=="__main__":load_document_from_local_disk()
sample.docx is the sample file used in this example. Click here to download it.