-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from groupdocs-viewer/python-net-cad-section
Viewer for Python - Implemented CAD File processing, PDF Optimization Options and more.
- Loading branch information
Showing
52 changed files
with
1,677 additions
and
275 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
40 changes: 40 additions & 0 deletions
40
...eloper-guide/rendering-documents/rendering-to-pdf/adjust-jpeg-images-quality.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
id: adjust-jpeg-images-quality | ||
url: viewer/python-net/adjust-jpeg-images-quality | ||
title: Specify the JPEG image quality | ||
weight: 3 | ||
description: "Adjust JPEG images quality when rendering documents to PDF with GroupDocs.Viewer for Python via .NET" | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
--- | ||
Decreasing the JPG images quality reduces the size of the output file. | ||
|
||
To adjust images quality, set the [image_quality](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/#properties) property of the [PdfViewOptions](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/) class. The value must be between 1 (minimum quality) and 100. The default value is 90. | ||
|
||
To set the image quality, follow these steps: | ||
|
||
1. Instantiate the [Viewer](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer/viewer) class. Specify the source document path as a constructor parameter. | ||
1. Instantiate the [PdfViewOptions](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfviewoptions) object. | ||
2. Set the [PdfViewOptions.pdf_optimization_options](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfviewoptions/#properties) value as instantiated [PdfOptimizationOptions](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/) object. | ||
3. Set the [PdfViewOptions.pdf_optimization_options.image_quality](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/#properties) value. | ||
4. Call the [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 adjust JPG image quality in the output PDF document: | ||
|
||
{{< tabs "example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("sample.docx") as viewer: | ||
# Create view options. | ||
viewOptions = gvo.PdfViewOptions() | ||
|
||
# Specify the JPG image quality. | ||
pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
pdf_optimization_options.image_quality = 50 | ||
# Specify pdf_optimization_options object | ||
viewOptions.pdf_optimization_options = pdf_optimization_options | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} |
21 changes: 21 additions & 0 deletions
21
...r-guide/rendering-documents/rendering-to-pdf/optimization-pdf-options/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
id: optimization-pdf-options | ||
url: viewer/python-net/optimization-pdf-options | ||
title: Optimize the output PDF file | ||
linkTitle: Optimize the output PDF file | ||
weight: 6 | ||
description: "This topic describes how to optimize PDF file in the GroupDocs.Viewer Python API for web browser or to reduce size." | ||
keywords: convert to pdf, optimize size, optimize browser, optimize web, pdf reduce size | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
GroupDocs.Viewer allows you to optimize the output PDF file for a web browser or to reduce the file size by optimizing resources. | ||
|
||
Optimization for a web allows a browser to display the first pages of a PDF file when you open the document, instead of waiting for the entire file to download. | ||
|
||
Resource optimization allows you to reduce the size of the output PDF file. While optimizing, GroupDocs.Viewer may reduce the image size or quality, remove notes or form fields, remove objects, fonts, or personal information from a document, and so on. | ||
|
||
You can also optimize an existing PDF file. To do this, open it, specify the optimization parameters, and save the output file. | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
...documents/rendering-to-pdf/optimization-pdf-options/optimization-pdf-for-web.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
id: optimization-pdf-for-web | ||
url: viewer/python-net/optimization-pdf-for-web | ||
title: Optimize a PDF file for a browser | ||
linkTitle: Optimize a PDF file for a browser | ||
weight: 1 | ||
description: "This topic describes how to optimize PDF file using the GroupDocs.Viewer Python API for web browser or to reduce size." | ||
keywords: convert to pdf, optimize browser, optimize web | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
This optimization allows a browser to display the first pages of a PDF file when you open the document, instead of waiting for the entire file to download. | ||
|
||
The following code snippet shows how to optimize a PDF file for browser: | ||
{{< tabs "Example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("sample.docx") as viewer: | ||
|
||
viewOptions = gvo.PdfViewOptions() | ||
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
viewOptions.pdf_optimization_options.lineriaze = True | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} |
28 changes: 28 additions & 0 deletions
28
...cuments/rendering-to-pdf/optimization-pdf-options/optimization-pdf-resources.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
id: optimization-pdf-resources | ||
url: viewer/python-net/optimization-pdf-resources | ||
title: Optimize the PDF file resources | ||
linkTitle: Optimize the PDF file resources | ||
weight: 2 | ||
description: "This topic describes how to optimize PDF file using the GroupDocs.Viewer Python API to reduce size." | ||
keywords: convert to pdf, optimize size, pdf reduce size | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
Resource optimization allows you to reduce the size of the output PDF file. While optimizing, GroupDocs.Viewer may reduce the image size or quality, remove notes or form fields, remove objects, fonts, or personal information from a document, and so on. | ||
|
||
The following code snippet shows how to optimize the PDF file by default: | ||
|
||
{{< tabs "Example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("sample.docx") as viewer: | ||
|
||
viewOptions = gvo.PdfViewOptions() | ||
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} |
32 changes: 32 additions & 0 deletions
32
...ents/rendering-to-pdf/optimization-pdf-options/optimization-pdf-spreadsheets.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
id: optimization-pdf-spreadsheets | ||
url: viewer/python-net/optimization-pdf-spreadsheets | ||
title: Optimize spreadsheets in a PDF file | ||
linkTitle: Optimize spreadsheets in a PDF file | ||
weight: 3 | ||
description: "This topic describes how to optimize spreadsheets in a PDF file using the GroupDocs.Viewer Python API." | ||
keywords: convert to pdf, optimize browser, optimize web | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
This optimization allows to reduce the output file size by setting up border lines. Besides that, it removes the Arial and Times New Roman characters of 32-127 codes. | ||
|
||
The default value is `False`. | ||
|
||
|
||
The following code snippet shows how to optimize spreadsheets in a PDF file: | ||
|
||
{{< tabs "Example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("invoice.xlsx") as viewer: | ||
|
||
viewOptions = gvo.PdfViewOptions() | ||
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
viewOptions.pdf_optimization_options.optimize_spreadsheets = True | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} |
11 changes: 11 additions & 0 deletions
11
...-documents/rendering-to-pdf/optimization-pdf-options/optimize-content/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
id: optimize-content | ||
url: viewer/python-net/optimize-content | ||
title: Optimize content | ||
weight: 5 | ||
description: "Optimize content of a PDF file using GroupDocs.Viewer for Python via .NET " | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
isMenuItemWithNoContent: True | ||
--- | ||
|
35 changes: 35 additions & 0 deletions
35
...ptimization-pdf-options/optimize-content/optimization-pdf-remove-annotations.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
id: optimization-pdf-remove-annotations | ||
url: viewer/python-net/optimization-pdf-remove-annotations | ||
title: Remove annotations | ||
linkTitle: Remove annotations | ||
weight: 1 | ||
description: "This topic describes how to remove annotations from PDF file using the GroupDocs.Viewer Python API." | ||
keywords: convert to pdf, optimize size, pdf reduce size, remove annotations | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
If the output PDF file contains annotations, you can remove them to reduce the file size. | ||
|
||
To remove annotations, set the [remove_annotations](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/#properties) property to `True`. | ||
|
||
The following code snippet shows how to remove annotations from the file: | ||
|
||
{{< tabs "Example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("sample.docx") as viewer: | ||
|
||
viewOptions = gvo.PdfViewOptions() | ||
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
viewOptions.pdf_optimization_options.remove_annotations = True | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} | ||
|
||
The following image demonstrates the result: | ||
|
||
![Remove annotations](/viewer/net/images/developer-guide/pdf-rendering/optimization/optimization-pdf-remove-annotations.png) |
35 changes: 35 additions & 0 deletions
35
...pdf/optimization-pdf-options/optimize-content/optimization-pdf-remove-fields.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
id: optimization-pdf-remove-fields | ||
url: viewer/python-net/optimization-pdf-remove-fields | ||
title: Remove form fields | ||
linkTitle: Remove form fields | ||
weight: 2 | ||
description: "This topic describes how to remove form fields from PDF file using the GroupDocs.Viewer Python API." | ||
keywords: convert to pdf, optimize size, pdf reduce size, remove fields | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
toc: True | ||
--- | ||
If the output PDF file contains form fields, you can flatten them to reduce the file size. | ||
|
||
To remove form fields, set the [remove_form_fields](https://reference.groupdocs.com/viewer/python-net/groupdocs.viewer.options/pdfoptimizationoptions/#properties) property to `True`. | ||
|
||
The following code snippet shows how to flatten form fields in the file: | ||
|
||
{{< tabs "Example1">}} | ||
{{< tab "Python" >}} | ||
```python | ||
with gv.Viewer("sample.docx") as viewer: | ||
|
||
viewOptions = gvo.PdfViewOptions() | ||
viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions() | ||
viewOptions.pdf_optimization_options.remove_form_fields = True | ||
|
||
viewer.view(viewOptions) | ||
``` | ||
{{< /tab >}} | ||
{{< /tabs >}} | ||
|
||
The following image demonstrates the result: | ||
|
||
![Remove fields](/viewer/net/images/developer-guide/pdf-rendering/optimization/optimization-pdf-remove-fields.png) |
11 changes: 11 additions & 0 deletions
11
...ng-documents/rendering-to-pdf/optimization-pdf-options/optimize-fonts/_index.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
id: optimize-fonts | ||
url: viewer/python-net/optimize-fonts | ||
title: Optimize fonts | ||
weight: 6 | ||
description: "Optimize fonts in a PDF file using GroupDocs.Viewer for Python via .NET" | ||
productName: GroupDocs.Viewer for Python via .NET | ||
hideChildren: False | ||
isMenuItemWithNoContent: True | ||
--- | ||
|
Oops, something went wrong.