Skip to content

Commit

Permalink
python-net platform is added
Browse files Browse the repository at this point in the history
  • Loading branch information
RakhimAimaganbetov committed Apr 29, 2024
1 parent 904be86 commit 4571dc3
Show file tree
Hide file tree
Showing 402 changed files with 2,877 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
deploy_key
common/
common/
.DS_Store
46 changes: 46 additions & 0 deletions _index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Excellent file viewer component that empowers your C#, ASP.NET, and other .NET a
<li><a href="#viewer_net">.NET</a></li>
<li><a href="#viewer_java">Java</a></li>
<li><a href="#viewer_nodejs-java">Node.js</a></li>
<li><a href="#viewer_python-net">Python</a></li>
</ul>
</div>

Expand Down Expand Up @@ -166,6 +167,51 @@ Excellent file viewer component that empowers your C#, ASP.NET, and other .NET a
<a class="gdoc-platform__footer-btn" href='/viewer/nodejs-java/'>More</a>
</div>
</div>
<div class="gdoc-platform">
<a id="viewer_python-net"></a>
<div class="gdoc-platform__header">
<svg class="gdoc-platform__header-icon"><use xlink:href="/img/groupdocs-stack.svg#python"></use></svg>
<a class="gdoc-platform__header-title" href='/viewer/python-net/'>GroupDocs.Viewer for Python via .Net</a>
<a class="gdoc-platform__header-btn" href='/viewer/python-net/'>More</a>
</div>
<div class="gdoc-platform__cols">
<div class="gdoc-platform__col">
<div class="gdoc-platform__col-title">
<svg class="gdoc-platform__col-icon"><use xlink:href="/img/groupdocs-stack.svg#time"></use></svg>
<div>Getting Started</div></div>
<div class="gdoc-platform__col-descr">Start quickly with our getting started documentation</div>
<ul class="gdoc-platform__col-links">
<li> <a href='/viewer/python-net/features-overview/'>Features Overview</a></li>
<li> <a href='/viewer/python-net/supported-document-formats/'>Supported Document Formats</a></li>
<li> <a href='/viewer/python-net/system-requirements/'>System Requirements</a></li>
<li> <a href='/viewer/python-net/installation/'>Installation</a></li>
</ul>
</div>
<div class="gdoc-platform__col">
<div class="gdoc-platform__col-title">
<svg class="gdoc-platform__col-icon"><use xlink:href="/img/groupdocs-stack.svg#document"></use></svg>
<div>Document rendering</div></div>
<div class="gdoc-platform__col-descr">Articles and guidelines for document rendering</div>
<ul class="gdoc-platform__col-links">
<li> <a href='/viewer/python-net/rendering-to-pdf/'>Render to PDF</a></li>
<li> <a href='/viewer/python-net/rendering-to-html/'>Render to HTML</a></li>
<li> <a href='/viewer/python-net/add-text-watermark/'>Add text watermarks</a></li>
</ul>
</div>
<div class="gdoc-platform__col">
<div class="gdoc-platform__col-title">
<svg class="gdoc-platform__col-icon"><use xlink:href="/img/groupdocs-stack.svg#git-big"></use></svg>
<div>Python via .Net Code Examples</div></div>
<div class="gdoc-platform__col-descr">Open-source projects for APIs example usage</div>
<ul class="gdoc-platform__col-links gdoc-platform__col-links--alt">
<li> <a href='https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Node.js-via-Java'>GroupDocs.Viewer for Python via .Net</a></li>
</ul>
</div>
</div>
<div class="gdoc-platform__footer">
<a class="gdoc-platform__footer-btn" href='/viewer/python-net/'>More</a>
</div>
</div>

</div>

Expand Down
1 change: 1 addition & 0 deletions build_docs.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ call git submodule foreach git pull origin master
xcopy java common\content\%PRODUCT%\java /s /e /Y /i
xcopy net common\content\%PRODUCT%\net /s /e /Y /i
xcopy nodejs-java common\content\%PRODUCT%\nodejs-java /s /e /Y /i
xcopy python-net common\content\%PRODUCT%\python-net /s /e /Y /i
xcopy _index.md common\content\%PRODUCT%
cd common
call hugo server --config config-geekdoc.toml,ignore-total-config.toml,show-feedback-config.toml
1 change: 1 addition & 0 deletions build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ git submodule foreach git pull origin master
mkdir -p common/content/$PRODUCT/java && cp -r java common/content/$PRODUCT/
mkdir -p common/content/$PRODUCT/net && cp -r net common/content/$PRODUCT/
mkdir -p common/content/$PRODUCT/nodejs-java && cp -r nodejs-java common/content/$PRODUCT/
mkdir -p common/content/$PRODUCT/python-net && cp -r python-net common/content/$PRODUCT/
cp -r _index.md common/content/$PRODUCT
cd common
hugo server --config config-geekdoc.toml,ignore-total-config.toml,show-feedback-config.toml
96 changes: 96 additions & 0 deletions python-net/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
id: home
url: viewer/python-net
title: GroupDocs.Viewer for Python via .Net
linkTitle: GroupDocs.Viewer for Python
weight: 1
description: "GroupDocs.Viewer for Python allows you to render documents in various formats as HTML, PDF, JPEG, and PNG files. You do not need to use third-party software to view files within your Python application."
keywords: render files, view files, HTML, PDF, JPEG, PNG
productName: GroupDocs.Viewer for Python via .Net
hideChildren: True
fullWidth: True
AddLibInfoScript: True
---

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABuCAYAAADGWyb7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAwvSURBVHgB7Z1PbBzVHcd/v7dWqqREbKBqGxTkDaiReood1zHi0DhSb42EObWXKo5UDvSSpFK5QVK4gYSTUw9UwqiH0lMSCbjG7qEiDskaqVJForaOEpGWNrAo/0Rg34/f782OM56dWb/592bWno8UZnfsnTXvO78/7/fem4cwhFD72THQX49pwBYAjiJAk8+O9X7Kr7EZ+kSHz3UAwRyJYIXPXVMKlgFGVnD8b8swZCBUHGpPN0HfnQGl9hLRNBC1+oXJAcQFRBGSFgG2LeD4QgcqTCWFo/YzLQB9mAhFqGkoAxaSqHtOqZGzOP7hClSMyggnlqX1nVnExnOliRUHW6ImOt1QjYWqiFi6cGxd06DpMIGeKcQF5gwBziuFvy9bwNKEE8E4Zp2onHXZYmKiEXABSsC5cEMvWBhPwCOuLdCZcF52eH+OgGZhA+LahToRjtpTR0nrk8MQwzKywgKebkxcOAUFU6hwktazW3x7w7hFe1ZQqYNFWp+CgvCsrNvehKIJLfYw7e6lqWNQELlbnIllcPcEaSzsjx4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vjZo17ZkisMXnhFBRAYcIJm9Z1yswsHlHJ0zX2fQU4wLM+OLoJBCzUyoI4EU4Q69NdfRIRDsMGROaIKLX1eN6xLA5nwvkY90n09oYZURe32OVxtNB2z4V/LZSE7ChvNicfVgFLEmz166FkhsyFdtglnlUa3ylLMJ/ShfMRAbmIN02oj1ZuoJatS1YxcQybdxXD1qMywgUxViib7Zp9W0typSJWlxbViJovMq1PSyWFC0Lt6SZ0701rxGkWcm9BQnbkKYJc5VhUoJdBffdsVSwrjsoLF4WMRoDCljY7ceEoC9ris012sVKl8f8F6cDD6YXLHKc65tGB8uTALiznVfh1ybfJD5kBiJZdnAAAAABJRU5ErkJggg==" alt="groupdocs-viewer-python-home" align="left" style="width:110px; margin: 0 30px 30px 0"/>

<img src="https://img.shields.io/nuget/v/groupdocs.viewer?label=GroupDocs.Viewer%20for%20.NET%20NuGet" alt="Nuget package">
<img src="https://img.shields.io/nuget/dt/GroupDocs.Viewer?label=nuget%20downloads" alt="Nuget downloads">

{{< button style="primary" link="https://releases.groupdocs.com/viewer/python-net/release-notes/" >}} <svg class="gdoc-icon gdoc-product-doc__btn-icon"><use xlink:href="/img/groupdocs-stack.svg#document"></use></svg> Release notes {{< /button >}}
{{< button style="primary" link="https://pypi.org/project/groupdocs.viewer" >}} {{< icon "gdoc_download" >}} Package repository {{< /button >}}

GroupDocs.Viewer for Python is a powerful, high-performance, and cross-platform library that allows you to build desktop and web [file viewer applications](https://en.wikipedia.org/wiki/File_viewer).

GroupDocs.Viewer supports over [170 popular file formats](/viewer/python-net/supported-document-formats). Load text documents, spreadsheets, presentations, PDF files, web pages, email messages, and images and render/display them in HTML, PDF, PNG, and JPEG formats. You can render the entire document or specific pages.

GroupDocs.Viewer ships with a wide range of options that allow you to control the rendering process and customize the output files. For example, you can protect the output PDF file and reorder its pages, generate responsive HTML pages, adjust the size and quality of output images, add text watermarks, and cache the results.

------

{{< columns >}}
<p><b>About GroupDocs.Viewer</b></p>
<hr><p>OVERVIEW</p></hr>
<ul>
<li><a href='{{< ref "/viewer/python-net/product-overview.md" >}}'>Product overview</a></li>
<li><a href='{{< ref "/viewer/python-net/getting-started/features-overview" >}}'>Main features</a></li>
<li><a href='{{< ref "/viewer/python-net/getting-started/supported-document-formats.md" >}}'>Supported file formats</a></li>
</ul>

<p>GET STARTED</p>
<ul>
<li><a href='{{< ref "/viewer/python-net/getting-started/system-requirements.md" >}}'>System requirements</a></li>
<li><a href='{{< ref "/viewer/python-net/getting-started/installation.md" >}}'>Installation</a></li>
<li><a href='{{< ref "/viewer/python-net/getting-started/licensing-and-subscription.md" >}}'>Licensing</a></li>
</ul>

<--->

<p><b>Developer Guide</b></p>
<hr><p>RENDERING BASICS</p></hr>
<ul>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-word-documents.md" >}}'>Render Word documents</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-spreadsheets/render-excel-and-apple-numbers-spreadsheets.md" >}}'>Render spreadsheet files</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-presentations.md" >}}'>Render presentations</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-pdf-documents.md" >}}'>Render PDF files</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-web-documents.md" >}}'>Render web documents</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-text-files.md" >}}'>Render text and code files</a></li>
<li><a href='{{< ref "viewer/python-net/rendering-basics/render-images.md" >}}'>Render images</a></li>
</ul>

<p>HOW-TO GUIDES</p>
<ul>
<li><a href='{{< ref "/viewer/python-net/developer-guide/loading-documents/loading-documents-from-different-sources/_index.md" >}}'>Load documents from different sources</a></li>
<li><a href='{{< ref "/viewer/python-net/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md" >}}'>Retrieve document information</a></li>
<li><a href='{{< ref "viewer/python-net/developer-guide/processing-attachments/how-to-extract-and-save-attachments.md" >}}'>Extract and save attachments</a></li>
<li><a href='{{< ref "viewer/python-net/developer-guide/rendering-documents/add-text-watermark.md" >}}'>Add text watermarks</a></li>
<li><a href='{{< ref "viewer/python-net/developer-guide/caching-results/_index.md" >}}'>Cache rendering results</a></li>
</ul>

<p>API REFERENCE</p>
<ul>
<li><a href="https://reference.groupdocs.com/viewer/python-net/">GroupDocs.Viewer for Python via .Net API Reference</a></li>
</ul>

<--->

<p><b>Useful Resources</b></p>
<hr><p>DEMOS AND EXAMPLES</p></hr>
<ul>
<li><a href="https://products.groupdocs.app/viewer/total">View documents online</a></li>
<li><a href="https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Python-via-Java">Download examples and demos from GitHub</a></li>
<li><a href='{{< ref "/viewer/python-net/getting-started/how-to-run-examples.md" >}}'>How to run examples</a></li>
</ul>

<p>VERSION HISTORY</p>
<ul>
<li><a href='https://releases.groupdocs.com/viewer/python-net/release-notes/'>GroupDocs.Viewer for Python via .Net Release Notes</a></li>
</ul>

<p>TECHNICAL SUPPORT</p>
<ul>
<li><a href="https://forum.groupdocs.com/">Free Support Forum for GroupDocs Products</a></li>
<li><a href="https://helpdesk.groupdocs.com/">Paid Support Helpdesk for GroupDocs Products</a></li>
</ul>

{{< /columns >}}
11 changes: 11 additions & 0 deletions python-net/developer-guide/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
id: developer-guide
url: viewer/python-net/developer-guide
title: Developer Guide
weight: 4
description: "Explains GroupDocs.Viewer for Python file viewer features and shows how to view PDF, Word, Excel, PowerPoint documents inside your JavaScript applications"
keywords: GroupDocs.Viewer Developer Guide, GroupDocs.Viewer Java Developer Guide, GroupDocs.Viewer Developer Guide Java, Using GroupDocs.Viewer for Python, GroupDocs.Viewer for Python use cases
productName: GroupDocs.Viewer for Python via .Net
hideChildren: False
isMenuItemWithNoContent: True
---
50 changes: 50 additions & 0 deletions python-net/developer-guide/caching-results/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: caching-results
url: viewer/python-net/caching-results
title: Cache results
weight: 5
keywords: caching,caching results,groupdocs.viewer
description: "This article contains caching use-cases with GroupDocs.Viewer within your Python applications."
productName: GroupDocs.Viewer for Python via .Net
hideChildren: False
---
Caching saves rendering results to a specified location, such as a local disk. When you re-request the rendering results, GroupDocs.Viewer does not render again, but uses the cached results.
As a document can take a long time to render, use caching if you expect to reuse the rendering results.

To enable caching, follow these steps:

1. Instantiate the desired cache object (for example, [FileCache](#) to store document rendering results at the local drive)
2. Instantiate the [ViewerSettings](#) object. Specify the cache object as a parameter of the constructor.
3. Instantiate the [Viewer](#) object. Specify the [ViewerSettings](#) object as a parameter of the constructor.
4. Call the [view()](#) method of the [Viewer](#) class.

The following code snippet shows how to enable caching and displays the difference between rendering a file and getting the cached results:

{{< tabs "example1">}}
{{< tab "JavaScript" >}}
```js
const cachePath = "cache";
const cache = new FileCache(cachePath);
const settings = new ViewerSettings(cache);

const viewer = new groupdocs.viewer.Viewer("sample.docx", settings)
const options = HtmlViewOptions.forEmbeddedResources();
const currentTimeMillis = Date.now()

viewer.view(options);
currentTimeMillis = Date.now() - currentTimeMillis
console.log("Time taken on first call to View method " + currentTimeMillis + " (ms).")
currentTimeMillis = Date.now()

viewer.view(options)
currentTimeMillis = Date.now() - currentTimeMillis
console.log("Time taken on second call to View method " + currentTimeMillis + " (ms).")
```
{{< /tab >}}
{{< /tabs >}}

The following image shows a sample console output:

![](/viewer/python-net/images/caching-results.png)

For details, please refer to the following pages:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: loading-documents-from-different-sources
url: viewer/python-net/loading-documents-from-different-sources
title: Load documents from different sources
weight: 1
description: "This article contains document loading use-cases with GroupDocs.Viewer within your Python applications."
keywords:
productName: GroupDocs.Viewer for Python via .Net
hideChildren: False
---
19 changes: 19 additions & 0 deletions python-net/developer-guide/processing-attachments/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: working-with-attachments
url: viewer/python-net/working-with-attachments
title: Process attachments
weight: 4
description: "Processing email attachments, embedded files, and compressed files with GroupDocs.Viewer for Python via .Net"
keywords: email attachments, embedded files, compressed files
productName: GroupDocs.Viewer for Python via .Net
hideChildren: False
---

Using GroupDocs.Viewer, you can list and save the following attachments:

* Email attachments
* Files embedded in PDF files
* Email messages contained by Outlook, LotusNotes and other storage files
* Compressed files

See following examples on how to process document attachments in more details:
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: how-to-extract-and-save-attachments
url: viewer/python-net/how-to-extract-and-save-attachments
title: Save attachments
weight: 2
description: "Save attachments and embedded files from PDF, Outlook data file or email"
keywords: Save attachments, embedded files from PDF, Outlook data file
productName: GroupDocs.Viewer for Python via .Net
hideChildren: False
---
To get and save attachments, follow these steps:

1. Instantiate the [Viewer](#) object. Specify a file that contains attachments.
2. Call the [getAttachments](#) method. It returns the attachment collection.
3. Iterate through the collection. To save an attachment, call the [saveAttachment](#) method.

The following code snippet shows how to get and save all attachments from the MSG file:

{{< alert style="info" >}}NOTE: provided code snippet suits all format families that support attachments: emails, Outlook data files, archives, and PDF documents.{{< /alert >}}

{{< tabs "example1">}}
{{< tab "Python" >}}
```python
with gv.Viewer("with_attachments.msg") as viewer:
attachments = viewer.get_attachments()

print("\nAttachments:")
for attachment in attachments:
print(attachment)

print(f"\nAttachments retrieved successfully.")
```
{{< /tab >}}
{{< /tabs >}}
Loading

0 comments on commit 4571dc3

Please sign in to comment.