diff --git a/java/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md b/java/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md index d0c5bd8..1178b93 100644 --- a/java/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md +++ b/java/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md @@ -2,7 +2,7 @@ id: how-to-check-if-file-is-encrypted url: viewer/java/how-to-check-if-file-is-encrypted title: Check if a file is encrypted -weight: 5 +weight: 3 description: "This article explains how to check if a file is encrypted using Java with GroupDocs.Viewer for Java." keywords: check, file, encrypted, Java productName: GroupDocs.Viewer for Java diff --git a/java/developer-guide/retrieving-document-information/how-to-determine-file-type.md b/java/developer-guide/retrieving-document-information/how-to-determine-file-type.md index aecc260..760d80d 100644 --- a/java/developer-guide/retrieving-document-information/how-to-determine-file-type.md +++ b/java/developer-guide/retrieving-document-information/how-to-determine-file-type.md @@ -2,7 +2,7 @@ id: how-to-determine-file-type url: viewer/java/how-to-determine-file-type title: Determine the file type -weight: 4 +weight: 1 description: "This article explains how to get a type of a file with GroupDocs.Viewer for Java using Java." keywords: productName: GroupDocs.Viewer for Java diff --git a/java/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md b/java/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md index d04588e..1214558 100644 --- a/java/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md +++ b/java/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md @@ -2,7 +2,7 @@ id: how-to-get-file-type-and-pages-count url: viewer/java/how-to-get-file-type-and-pages-count title: Get the format family and the additional information -weight: 4 +weight: 2 description: "This article explains how to get the format family and the additional information using Java with GroupDocs.Viewer for Java." keywords: productName: GroupDocs.Viewer for Java @@ -10,7 +10,7 @@ hideChildren: False --- A format family is a group of several file types for which an application provides additional information. For example, archive files (.7z, .rar, .zip, etc.) or Outlook files (.ost, .pst) are format families. -You can get the format family and the additional information using the [getViewInfo](https://reference.groupdocs.com/viewer/java/groupdocs.viewer/viewer/methods/getviewinfo) method that returns a [ViewInfo](https://reference.groupdocs.com/viewer/java/groupdocs.viewer.results/viewinfo) object. +You can get the format family and the additional information using the [getViewInfo](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/viewer/#getViewInfo-com.groupdocs.viewer.options.ViewInfoOptions-) method that returns a [ViewInfo](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer.results/viewinfo/) object. GroupDocs.Viewer provides additional information for the following format families: diff --git a/java/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md b/java/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md new file mode 100644 index 0000000..2be7fdc --- /dev/null +++ b/java/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md @@ -0,0 +1,42 @@ +--- +id: how-to-get-page-width-and-height +url: viewer/java/how-to-get-page-width-and-height +title: Get the width and height of the document pages +weight: 5 +description: "This article explains how to get the width and height of the document pages using GroupDocs.Viewer for Java." +keywords: +productName: GroupDocs.Viewer for Java +hideChildren: False +--- + +You can get the width and height of each document page using the [getViewInfo](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer/viewer/#getViewInfo-com.groupdocs.viewer.options.ViewInfoOptions-) method that returns a [ViewInfo](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer.results/viewinfo/) object. Use the [getPages](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer.results/viewinfo/#getPages--) method to access the collection that contains each [Page](https://reference.groupdocs.com/viewer/java/com.groupdocs.viewer.results/page/) of the document. + + +The following code snippet shows how to get the width and height of each document page: + +{{< tabs "example1">}} +{{< tab "Java" >}} +```java +import com.groupdocs.viewer.Viewer; +import com.groupdocs.viewer.options.ViewInfoOptions; +import com.groupdocs.viewer.results.ViewInfo; +// ... + +try (Viewer viewer = new Viewer("sample.pdf")) { + // Get file information. + ViewInfoOptions viewInfoOptions = ViewInfoOptions.forHtmlView(); + ViewInfo viewInfo = viewer.getViewInfo(viewInfoOptions); + + // Display width and height of each page. + for (Page page : viewInfo.getPages()) { + System.out.println("Page: " + page.getNumber() + "; Width: " + page.getWidth() + ", pixels"); + System.out.println("Page: " + page.getNumber() + "; Height: " + page.getHeight() + ", pixels"); + } +} +``` +{{< /tab >}} +{{< /tabs >}} + +The following image shows a sample console output: + +![](/viewer/java/images/how-to-get-page-width-and-height.png) \ No newline at end of file diff --git a/java/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md b/java/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md index 448b4c7..8b77f76 100644 --- a/java/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md +++ b/java/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md @@ -2,7 +2,7 @@ id: how-to-list-and-print-all-supported-file-types url: viewer/java/how-to-list-and-print-all-supported-file-types title: List and print all supported file types -weight: 5 +weight: 4 description: "This article explains how to list and print file types supported by GroupDocs.Viewer for Java" productName: GroupDocs.Viewer for Java hideChildren: False diff --git a/java/images/how-to-get-page-width-and-height.png b/java/images/how-to-get-page-width-and-height.png new file mode 100644 index 0000000..eede28b Binary files /dev/null and b/java/images/how-to-get-page-width-and-height.png differ diff --git a/net/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md b/net/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md index 4917671..9188b2c 100644 --- a/net/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md +++ b/net/developer-guide/retrieving-document-information/how-to-check-if-file-is-encrypted.md @@ -2,7 +2,7 @@ id: how-to-check-if-file-is-encrypted url: viewer/net/how-to-check-if-file-is-encrypted title: Check if a file is encrypted -weight: 5 +weight: 3 description: "This article explains how to check if a file is encrypted using .NET / C# with GroupDocs.Viewer for .NET." keywords: check, file, encrypted, C#, .NET productName: GroupDocs.Viewer for .NET diff --git a/net/developer-guide/retrieving-document-information/how-to-determine-file-type.md b/net/developer-guide/retrieving-document-information/how-to-determine-file-type.md index d496833..c5d76ba 100644 --- a/net/developer-guide/retrieving-document-information/how-to-determine-file-type.md +++ b/net/developer-guide/retrieving-document-information/how-to-determine-file-type.md @@ -2,7 +2,7 @@ id: how-to-determine-file-type url: viewer/net/how-to-determine-file-type title: Determine the file type -weight: 4 +weight: 1 description: "This article explains how to get a type of a file with GroupDocs.Viewer for .NET using .NET / C#." keywords: productName: GroupDocs.Viewer for .NET diff --git a/net/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md b/net/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md index 3b1aefd..e3d0191 100644 --- a/net/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md +++ b/net/developer-guide/retrieving-document-information/how-to-get-file-type-and-pages-count.md @@ -2,7 +2,7 @@ id: how-to-get-file-type-and-pages-count url: viewer/net/how-to-get-file-type-and-pages-count title: Get the format family and the additional information -weight: 4 +weight: 2 description: "This article explains how to get the format family and the additional information using .NET / C# with GroupDocs.Viewer for .NET." keywords: productName: GroupDocs.Viewer for .NET diff --git a/net/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md b/net/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md new file mode 100644 index 0000000..58ba23f --- /dev/null +++ b/net/developer-guide/retrieving-document-information/how-to-get-page-width-and-height.md @@ -0,0 +1,38 @@ +--- +id: how-to-get-page-width-and-height +url: viewer/net/how-to-get-page-width-and-height +title: Get the width and height of the document pages +weight: 5 +description: "This article explains how to get the width and height of the document pages using .NET / C# with GroupDocs.Viewer for .NET." +keywords: +productName: GroupDocs.Viewer for .NET +hideChildren: False +--- + +You can get the width and height of each document page 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 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.ForHtmlView(); + ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions); + + // 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 >}} + +The following image shows a sample console output: + +![](/viewer/net/images/how-to-get-page-width-and-height.png) \ No newline at end of file diff --git a/net/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md b/net/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md index 9282c8a..9e9669c 100644 --- a/net/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md +++ b/net/developer-guide/retrieving-document-information/how-to-list-and-print-all-supported-file-types.md @@ -2,7 +2,7 @@ id: how-to-list-and-print-all-supported-file-types url: viewer/net/how-to-list-and-print-all-supported-file-types title: List and print all supported file types -weight: 5 +weight: 4 description: "This article explains how to list and print file types supported by GroupDocs.Viewer for .NET" productName: GroupDocs.Viewer for .NET hideChildren: False diff --git a/net/images/how-to-get-page-width-and-height.png b/net/images/how-to-get-page-width-and-height.png new file mode 100644 index 0000000..603dd5c Binary files /dev/null and b/net/images/how-to-get-page-width-and-height.png differ