-
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.
Added the description how to get information about the output PDF file.
- Loading branch information
1 parent
2638597
commit 65bd12c
Showing
4 changed files
with
275 additions
and
39 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
37 changes: 37 additions & 0 deletions
37
net/developer-guide/retrieving-document-information/get-pdf-output-file-info.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,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 >}} |
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