c# - 如何控制 iOS 的 PDF 文件的页面
问题描述
我正在创建一个应用程序来向用户显示一些本地 PDF 文件。
该应用程序有 2 个功能:
- 显示本地 PDF(pdf 查看器)。
- 制作“交互式摘要”,以便用户可以在 PDF 页面之间导航。
在 Android 中,我使用 xamarin 的“PDF.JS”插件来显示所有 pdf 文件,它工作正常。通过使用“交互式摘要”,我可以轻松地在我想要的页面中打开 PDF。
另一方面,在 IOS 中,我使用 awebview
来显示 pdf。唯一的问题是在为 IOS 创建“交互式摘要”时,我无法弄清楚如何在我想要的页面中打开 PDF 文件。是否有任何库或函数可以让我访问它(pdf 页面)?
我附上了一些代码截图,以便你们了解发生了什么。
解决方案
我建议使用Syncfusion PDF。
它已经拥有您想要的所有功能:
<Grid x:Name="pdfViewGrid">
<syncfusion:SfPdfViewer x:Name="pdfViewerControl" InputFileStream="{Binding PdfDocumentStream}"/>
</Grid>
要更改页面:
<Button x:Name="goToNextButton" Grid.Column="3" BackgroundColor="Transparent" Image="PageDown.png" HorizontalOptions="Center" VerticalOptions="Center" Command="{Binding GoToNextPageCommand, Source={x:Reference Name=pdfViewerControl}}"/>
<Button x:Name="goToPreviousButton" Grid.Column="4" BackgroundColor="Transparent" Image="PageUp.png" HorizontalOptions="Center" VerticalOptions="Center" Command="{Binding GoToPreviousPageCommand, Source={x:Reference Name=pdfViewerControl}}"/>
推荐阅读
- amazon-web-services - Which object encryption options are available with Amazon Simple Storage Service (S3)??
- php - 从 php 调用 .net 服务
- html - turn div into link on mobile screen size
- android - My app lags for about a couple of seconds before it become responsive again
- javascript - how to read message in reject(r => new Error({ id, message: 'target'}));
- html - How to deal with params from form being nil? (NoMethodError)
- vba - 在访问表单上的动态记录集上获取 CurrentRecord
- c# - How do I convert Time(7) to .NET Ticks?
- image-processing - 特征匹配展示
- angularjs - JSON 中位置 4 的意外标记 m - 将字符串从弹簧控制器传递到角度控制器