Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeirvingweb/sfpdfviewerextensions
Useful Extensions for Syncfusion Xamarin Pdf Viewer (SfPdfViewer)
https://github.com/mikeirvingweb/sfpdfviewerextensions
csharp dotnet dotnet-maui nuget syncfusion uno-platform xamarin xamarin-forms
Last synced: 22 days ago
JSON representation
Useful Extensions for Syncfusion Xamarin Pdf Viewer (SfPdfViewer)
- Host: GitHub
- URL: https://github.com/mikeirvingweb/sfpdfviewerextensions
- Owner: mikeirvingweb
- Created: 2022-08-23T10:02:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-08T12:21:09.000Z (over 2 years ago)
- Last Synced: 2024-12-21T03:48:30.442Z (about 2 months ago)
- Topics: csharp, dotnet, dotnet-maui, nuget, syncfusion, uno-platform, xamarin, xamarin-forms
- Language: C#
- Homepage: https://www.nuget.org/packages/SfPdfViewerExtensions
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## SfPdfViewer Extensions
Useful Extensions for **Syncfusion Xamarin.Forms PDF Viewer Component (SfPdfViewer)**, to get the size and orientation of the PDF, per page.
Written to address shortcomings in the core functionality of [SfPdfViewer](https://www.nuget.org/packages/Syncfusion.Xamarin.SfPdfViewer).
### Current Extension Properties / Methods
public static Size PageSize(this SfPdfViewer sfPdfViewer, int page)
public static int PageWidth(this SfPdfViewer sfPdfViewer, int page) - returns -1 if an error should occur
public static int PageHeight(this SfPdfViewer sfPdfViewer, int page) - returns -1 if an error should occur
public static bool PageIsLandscape(this SfPdfViewer sfPdfViewer, int page) - returns false if an error should occur
public static bool PageIsPortrait(this SfPdfViewer sfPdfViewer, int page) - returns false if an error should occur## How to use
📦 Add the [SfPdfViewerExtensions NuGet Package](https://www.nuget.org/packages/SfPdfViewerExtensions) to your C# Solution in [Visual Studio](https://visualstudio.microsoft.com/).
🖥️ Command Line `dotnet add PROJECT package SfPdfViewerExtensions`
⚒️ Alternatively, clone this repository or take the `SfPdfViewerExtensions.cs` file from it.
✏️ Utilise the Extension Methods.
### Examples
using SfPdfViewerExtensions;
using Syncfusion.Drawing;
using Syncfusion.SfPdfViewer.XForms;SfPdfViewer sfPdfViewer = new SfPdfViewer();
/*
your code here,
load your PDF etc
*/
// get Size of Page 1. returns Size
Size pageSize = sfPdfViewer.PageSize(1);
// get Width of Page 1. returns int, returns -1 if an error should occur
int pageWidth = sfPdfViewer.PageWidth(1);
// get Height of Page 1. returns int, returns -1 if an error should occur
int pageHeight = sfPdfViewer.PageHeight(1);
// is Page 1 Landscape? returns bool, returns false if an error should occur
bool pageIsLandscape = sfPdfViewer.PageIsLandscape(1);
// is Page 1 Portrait? returns bool, returns false if an error should occur
bool pageIsPortrait = sfPdfViewer.PageIsPortrait(1);
### Contributions🍴 Feel free to Fork / Branch / Modify, raise any Pull Requests for changes.