Skip to content

Commit

Permalink
Added descriptions for PDF optimization options and Detect encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-A-Sokolov committed Nov 27, 2023
1 parent c9fb682 commit 8873e70
Show file tree
Hide file tree
Showing 19 changed files with 415 additions and 152 deletions.
2 changes: 1 addition & 1 deletion net/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GroupDocs.Viewer ships with a wide range of options that allow you to control th
<ul>
<li><a href='{{< ref "/viewer/net/developer-guide/loading-documents/loading-documents-from-different-sources/_index.md" >}}'>Load documents from different sources</a></li>
<li><a href='{{< ref "/viewer/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/net/developer-guide/processing-attachments/how-to-extract-and-save-attachments.md" >}}'>Extract and save attachments</a></li>
<li><a href='{{< ref "viewer/net/developer-guide/working-with-attachments.md" >}}'>Extract and save attachments</a></li>
<li><a href='{{< ref "viewer/net/developer-guide/rendering-documents/add-text-watermark.md" >}}'>Add text watermarks</a></li>
<li><a href='{{< ref "viewer/net/developer-guide/caching-results/_index.md" >}}'>Cache rendering results</a></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: detect-encoding-when-loading-documents
url: viewer/net/detect-encoding-when-loading-documents
title: Detect encoding when loading documents
weight: 5
description: "This article explains how to detect encoding when loading documents with GroupDocs.Viewer within your .NET applications."
keywords: get encoding, detect encoding
productName: GroupDocs.Viewer for .NET
hideChildren: False
---
You can detect the file encoding using [LoadOptions](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/loadoptions). If the encoding cannot be detected the default, GroupDocs.Viewer uses the default [encoding]({{< ref "viewer/net/developer-guide/loading-documents/specify-encoding-when-loading-documents.md" >}}).

This feature is supported for the following documents:

* [Plain-text (.txt) files](https://docs.fileformat.com/word-processing/txt/)
* [Comma-separated values (.csv)](https://docs.fileformat.com/spreadsheet/csv/)
* [Tab-separated values (.tsv)](https://docs.fileformat.com/spreadsheet/tsv/)

The following code snippet shows how to detect the document encoding:

{{< tabs "example1">}}
{{< tab "C#" >}}
```csharp
LoadOptions loadOptions = new LoadOptions();
loadOptions.DetectEncoding = true; // Enable encoding detection
using (Viewer viewer = new Viewer("employees.csv", loadOptions))
{
HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();

viewer.View(viewOptions);
}
```
{{< /tab >}}
{{< /tabs >}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: loading-external-resources
url: viewer/net/loading-external-resources
title: Loading of external resources containing by a document
weight: 5
weight: 6
keywords: set timeout, Groupdocs.Viewer
description: "This article explains how to manage loading of external resources contained by a document with GroupDocs.Viewer within your .NET applications."
productName: GroupDocs.Viewer for .NET
Expand Down
19 changes: 0 additions & 19 deletions net/developer-guide/processing-attachments/_index.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: allow-reuse-page-content
url: viewer/net/allow-reuse-page-content
title: Reuse page content
linkTitle: Reuse page content
weight: 9
description: "This topic describes how to reuse page content in a PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize size, pdf reduce size
productName: GroupDocs.Viewer for .NET
hideChildren: False
toc: True
---
This property allows you to reuse the content for identical pages when optimizing the document.

To allow reusing page content in a PDF file, set the [AllowReusePageContent](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/pdfoptimizationoptions/linkduplicatestreams/) property to `true`.

The following code snippet shows how to link duplicate streams in a PDF file:

{{< tabs "Example1">}}
{{< tab "C#" >}}
```csharp
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Domain.Documents.PostProcessing.Pdf.Optimization;
// ...
using (var viewer = new Viewer("sample.docx"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
AllowReusePageContent = true
};

viewer.View(viewOptions);
}
```
{{</ tab >}}
{{</ tabs >}}


Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: link-duplicate-streams
url: viewer/net/link-duplicate-streams
title: Link duplicate streams
linkTitle: Link duplicate streams
weight: 6
description: "This topic describes how to link duplicate streams in a PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize size, pdf reduce size
productName: GroupDocs.Viewer for .NET
hideChildren: False
toc: True
---
Sometimes a document contains several identical resource streams, like images. GroupDocs.Viewers can compare all resource streams. If streams are duplicated, it merges them leaving only one copy, changes the references appropriately, and removes copies of the object. This can significantly decrease the document size.

To link duplicate streams in a PDF file, set the [LinkDuplicateStreams](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/pdfoptimizationoptions/linkduplicatestreams/) property to `true`.

The following code snippet shows how to link duplicate streams in a PDF file:

{{< tabs "Example1">}}
{{< tab "C#" >}}
```csharp
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Domain.Documents.PostProcessing.Pdf.Optimization;
// ...
using (var viewer = new Viewer("sample.docx"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
LinkDuplicateStreams = true
};

viewer.View(viewOptions);
}
```
{{</ tab >}}
{{</ tabs >}}


Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: optimization-pdf-remove-annotations
url: viewer/net/optimization-pdf-remove-annotations
title: Remove annotations
linkTitle: Remove annotations
weight: 1
weight: 2
description: "This topic describes how to remove annotations from PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize size, pdf reduce size, remove annotations
productName: GroupDocs.Viewer for .NET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: optimization-pdf-remove-fields
url: viewer/net/optimization-pdf-remove-fields
title: Remove form fields
linkTitle: Remove form fields
weight: 2
weight: 3
description: "This topic describes how to remove form fields from PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize size, pdf reduce size, remove fields
productName: GroupDocs.Viewer for .NET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: optimization-pdf-resources
url: viewer/net/optimization-pdf-resources
title: Optimize the PDF file resources
linkTitle: Optimize the PDF file resources
weight: 2
weight: 1
description: "This topic describes how to optimize PDF file using the GroupDocs.Viewer .NET API (C#) to reduce size."
keywords: convert to pdf, optimize size, pdf reduce size
productName: GroupDocs.Viewer for .NET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: optimization-pdf-spreadsheets
url: viewer/net/optimization-pdf-spreadsheets
title: Optimize spreadsheets in a PDF file
linkTitle: Optimize spreadsheets in a PDF file
weight: 3
weight: 4
description: "This topic describes how to optimize spreadsheets in a PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize browser, optimize web
productName: GroupDocs.Viewer for .NET
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: remove-private-info
url: viewer/net/remove-private-info
title: Remove private information
linkTitle: Remove private information
weight: 5
description: "This topic describes how to remove private information from a PDF file using the GroupDocs.Viewer .NET API (C#)."
keywords: convert to pdf, optimize size, pdf reduce size
productName: GroupDocs.Viewer for .NET
hideChildren: False
toc: True
---
A PDF file often contains private information. GroupDocs.Viewer allows you to remove this information to protect sensitive data, enable secure document exchange and minimize the risks of data leakage.

To remove fonts in a PDF file, set the [RemovePrivateInfo](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.options/pdfoptimizationoptions/removeprivateinfo/) property to `true`.

The following code snippet shows how to remove private information from a PDF file:

{{< tabs "Example1">}}
{{< tab "C#" >}}
```csharp
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using GroupDocs.Viewer.Domain.Documents.PostProcessing.Pdf.Optimization;
// ...
using (var viewer = new Viewer("sample.docx"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions()
{
RemovePrivateInfo = true
};

viewer.View(viewOptions);
}
```
{{</ tab >}}
{{</ tabs >}}


Loading

0 comments on commit 8873e70

Please sign in to comment.