Skip to content

Commit

Permalink
Release notes edited.
Browse files Browse the repository at this point in the history
Added the description how to get information about the output PDF file.
  • Loading branch information
Pavel-A-Sokolov committed Jun 23, 2023
1 parent 2638597 commit 65bd12c
Show file tree
Hide file tree
Showing 4 changed files with 275 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: optimization-pdf-options
url: viewer/net/optimization-pdf-options
title: Optimize the output PDF file
linkTitle: Optimize the output PDF file
weight: 5
weight: 6
description: "This topic describes how to optimize PDF file in the GroupDocs.Viewer .NET API (C#) for web browser or to reduce size."
keywords: convert to pdf, optimize size, optimize browser, optimize web, pdf reduce size
productName: GroupDocs.Viewer for .NET
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
id: get-pdf-output-file-info
url: viewer/net/get-pdf-output-file-info
title: Get the PDF output file information
weight: 6
description: "This article explains how to get the PDF output file information using .NET / C# with GroupDocs.Viewer for .NET."
keywords:
productName: GroupDocs.Viewer for .NET
hideChildren: False
---

You can get the information about the PDF output file using the [GetViewInfo](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/methods/getviewinfo) method that returns a [ViewInfo](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo) object. The object contains the [Pages](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo/pages/) collection that represents each [Page](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/page/) of the document.

The following code snippet shows how to get the page count and the width and height of each document page:

{{< tabs "example1">}}
{{< tab "C#" >}}
```csharp
using (Viewer viewer = new Viewer("sample.pdf"))
{
// Get file information.
ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForPdfView();
ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions);

// Display page count.
Console.WriteLine("Pages count: " + viewInfo.Pages.Count);

// Display width and height of each page.
foreach (Page page in viewInfo.Pages)
{
Console.WriteLine($"Page: {page.Number}; Width: {page.Width}, pixels");
Console.WriteLine($"Page: {page.Number}; Height: {page.Height}, pixels");
}
}
```
{{< /tab >}}
{{< /tabs >}}
135 changes: 117 additions & 18 deletions net/release-notes/latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,144 @@ hideChildren: False
toc: True
---

There are 1 feature in this release.
There are 10 features and bug fixes in this release.

## Full list of changes in this release

| Key | Category | Summary |
| --- | --- | --- |
|VIEWERNET&#8209;4330|Feature|[Support PDF file optimizations](https://issue.saltov.dynabic.com/issues/VIEWERNET-4330)|
|VIEWERNET&#8209;4330|Feature|[Support PDF file optimizations](#support-pdf-file-optimizations)|
|VIEWERNET&#8209;4249|Feature|[Support retrieving view info when rendering to PDF](#support-retrieving-view-info-when-rendering-to-pdf)|
|VIEWERNET&#8209;4323|Fix|DOCX to PNG: Application consumes all available memory|
|VIEWERNET&#8209;4248|Fix|Aspose.PDF dependency creates temp files|
|VIEWERNET&#8209;2428|Fix|Incorrect position of images and characters in a docx file|
|VIEWERNET&#8209;4120|Fix|SetLicense is not working with renewed license|
|VIEWERNET&#8209;4385|Fix|PDF file loading slow (.Net Core project)|
|VIEWERNET&#8209;4358|Fix|A workbook must contain at least a visible worksheet|
|VIEWERNET&#8209;4023|Fix|Presentation Text with 3D effect incorrectly rendered on Linux|
|VIEWERNET&#8209;4138|Fix|Empty \<title\> tags being created when loading PDF and EPub documents|

## Major Features

This release includes the following feature:
This release includes two features:

* [Support PDF file optimizations](#support-pdf-file-optimizations)
* [Added support for PDF file optimizations](#support-pdf-file-optimizations)
* [Added support for retrieving view info when rendering to PDF](#support-retrieving-view-info-when-rendering-to-pdf)

### Support PDF file optimizations
### Support PDF file optimizations

This feature allows you to optimize the output PDF file for a web browser or to reduce the file size using various options.

You can also optimize an existing PDF file. To do this, open it and save the resulting file, specifying the optimization parameters.

For details, see [Supported PDF file optimization options](/viewer/net/optimization-pdf-options/).
For details, see [Optimize the output PDF file](/viewer/net/optimization-pdf-options/).

The following code snippet shows how to optimize the PDF resources using the default settings:
The following code snippet shows how to enable all available optimizations:

{{< tabs "Example2">}}
{{< tabs "Example1">}}
{{< tab "C#" >}}
```cs
```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();

viewer.View(viewOptions);
}
using (Viewer viewer = new Viewer("invoice.pdf"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
Lineriaze = true, // Optimize PDF for web-browsers
OptimizeSpreadsheets = true, // Optimize spreadsheets for a smaller size
SubsetFonts = true, // Keep the characters that actually used
RemoveAnnotations = true, // Remove annotations
RemoveFormFields = true, // Remove form fields
ConvertToGrayScale = true, // Convert images to grayscale
CompressImages = true, // Enable images compression
ResizeImages = true, // Enable resize images with lower resolution
MaxResolution = 150, // Set resolution for images, default value is 300
ImageQuality = 30, // Set image quality, default value is 100
};

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

### Support retrieving view info when rendering to PDF

To get information about output PDF file, call the `GetViewInfo` method.

For details, see [Get the PDF output file information](/viewer/net/get-pdf-output-file-info).

The following code snippet shows how to get information about the output PDF file:

{{< tabs "Example2">}}
{{< tab "C#" >}}
```csharp
using (Viewer viewer = new Viewer("resume.docx"))
{
ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForPdfView();
ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions);

//Get number of pages and pages size
}
```
{{</ tab >}}
{{</ tabs >}}


## Obsolete API

The following public API is now deprecated and will be removed in the future versions.

### PdfViewOptions.JpgQuality

Please use the new API to set image quality when rendering to PDF.

{{< tabs "Example3">}}
{{< tab "C#" >}}
```cs
using (Viewer viewer = new Viewer("invoice.pdf"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
CompressImages = true,
ImageQuality = 30, // Default value is 100
};

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

### PdfViewOptions.Optimize

Please use the new API to optimize Excel spreadsheets when rendering to PDF.

{{< tabs "Example4">}}
{{< tab "C#" >}}
```cs
using (Viewer viewer = new Viewer("inventory.xlsx"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
OptimizeSpreadsheets = true // Optimize border Excel spreadsheets border lines and fonts
};

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

## Updates in the further version

The next version of GroupDocs.Viewer for .NET will incorporate the following major changes, some of which may have an impact on compatibility with previous versions.

### Drop support for .NET Framework 4.0

Following [.NET Framework Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-framework), we are dropping support for `.NET Framework 4.0` in the next version of GroupDocs.Viewer. The `.NET Framework 4.0` assembly will be replaced with the `.NET Framework 4.6.2` assembly in the distribution packages.
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,150 @@ title: GroupDocs.Viewer for .NET 23.6 Release Notes
weight: 90
description: "Bugs-fixes and features that are shipped in GroupDocs.Viewer for .NET 23.6"
keywords: release notes, groupdocs.viewer, .net, 23.6
productName: GroupDocs.Viewer for .NET
hideChildren: False
productName: "GroupDocs.Viewer for .NET"
hideChildren: false
toc: True
---

There are 1 feature in this release.

There are 10 features and bug fixes in this release.

## Full list of changes in this release

| Key | Category | Summary |
| --- | --- | --- |
|VIEWERNET&#8209;4330|Feature|[Support PDF file optimizations](https://issue.saltov.dynabic.com/issues/VIEWERNET-4330)|
|VIEWERNET&#8209;4330|Feature|[Support PDF file optimizations](#support-pdf-file-optimizations)|
|VIEWERNET&#8209;4249|Feature|[Support retrieving view info when rendering to PDF](#support-retrieving-view-info-when-rendering-to-pdf)|
|VIEWERNET&#8209;4323|Fix|DOCX to PNG: Application consumes all available memory|
|VIEWERNET&#8209;4248|Fix|Aspose.PDF dependency creates temp files|
|VIEWERNET&#8209;2428|Fix|Incorrect position of images and characters in a docx file|
|VIEWERNET&#8209;4120|Fix|SetLicense is not working with renewed license|
|VIEWERNET&#8209;4385|Fix|PDF file loading slow (.Net Core project)|
|VIEWERNET&#8209;4358|Fix|A workbook must contain at least a visible worksheet|
|VIEWERNET&#8209;4023|Fix|Presentation Text with 3D effect incorrectly rendered on Linux|
|VIEWERNET&#8209;4138|Fix|Empty \<title\> tags being created when loading PDF and EPub documents|

## Major Features

This release includes the following feature:
This release includes two features:

* [Support PDF file optimizations](#support-pdf-file-optimizations)
* [Added support for PDF file optimizations](#support-pdf-file-optimizations)
* [Added support for retrieving view info when rendering to PDF](#support-retrieving-view-info-when-rendering-to-pdf)

### Support PDF file optimizations
### Support PDF file optimizations

This feature allows you to optimize the output PDF file for a web browser or to reduce the file size using various options.

You can also optimize an existing PDF file. To do this, open it and save the resulting file, specifying the optimization parameters.

For details, see [Supported PDF file optimization options](/viewer/net/optimization-pdf-options/).
For details, see [Optimize the output PDF file](/viewer/net/optimization-pdf-options/).

The following code snippet shows how to optimize the PDF resources using the default settings:
The following code snippet shows how to enable all available optimizations:

{{< tabs "Example2">}}
{{< tabs "Example1">}}
{{< tab "C#" >}}
```cs
```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();

viewer.View(viewOptions);
}
using (Viewer viewer = new Viewer("invoice.pdf"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
Lineriaze = true, // Optimize PDF for web-browsers
OptimizeSpreadsheets = true, // Optimize spreadsheets for a smaller size
SubsetFonts = true, // Keep the characters that actually used
RemoveAnnotations = true, // Remove annotations
RemoveFormFields = true, // Remove form fields
ConvertToGrayScale = true, // Convert images to grayscale
CompressImages = true, // Enable images compression
ResizeImages = true, // Enable resize images with lower resolution
MaxResolution = 150, // Set resolution for images, default value is 300
ImageQuality = 30, // Set image quality, default value is 100
};

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

### Support retrieving view info when rendering to PDF

To get information about output PDF file, call the `GetViewInfo` method.

For details, see [Get the PDF output file information](/viewer/net/get-pdf-output-file-info).

The following code snippet shows how to get information about the output PDF file:

{{< tabs "Example2">}}
{{< tab "C#" >}}
```csharp
using (Viewer viewer = new Viewer("resume.docx"))
{
ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForPdfView();
ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions);

//Get number of pages and pages size
}
```
{{</ tab >}}
{{</ tabs >}}


## Obsolete API

The following public API is now deprecated and will be removed in the future versions.

### PdfViewOptions.JpgQuality

Please use the new API to set image quality when rendering to PDF.

{{< tabs "Example3">}}
{{< tab "C#" >}}
```cs
using (Viewer viewer = new Viewer("invoice.pdf"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
CompressImages = true,
ImageQuality = 30, // Default value is 100
};

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

### PdfViewOptions.Optimize

Please use the new API to optimize Excel spreadsheets when rendering to PDF.

{{< tabs "Example4">}}
{{< tab "C#" >}}
```cs
using (Viewer viewer = new Viewer("inventory.xlsx"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
{
OptimizeSpreadsheets = true // Optimize border Excel spreadsheets border lines and fonts
};

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

## Updates in the further version

The next version of GroupDocs.Viewer for .NET will incorporate the following major changes, some of which may have an impact on compatibility with previous versions.

### Drop support for .NET Framework 4.0

Following [.NET Framework Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-framework), we are dropping support for `.NET Framework 4.0` in the next version of GroupDocs.Viewer. The `.NET Framework 4.0` assembly will be replaced with the `.NET Framework 4.6.2` assembly in the distribution packages.

0 comments on commit 65bd12c

Please sign in to comment.