我只想用PDFKit绘制一个PDF文件。这听起来很简单,但我遇到了很多麻烦。从文档中看,墨迹注释似乎适合这一点。这是我的密码:
/// Adds a new annotation
func addAnnotation(color: UIColor, point: CGPoint) {
currentPage = pdfView.page(for: point, nearest: false)
// Here I convert the coordinates to the document and create a new annotation
if currentP
我使用PDFKit来显示简单的PDF格式,当我将它们显示在UIView中的屏幕上时,我使用了下面的代码。
目标:-从填充视图的内容开始??想要填充整个屏幕的宽度。
override func viewDidLoad() {
super.viewDidLoad()
if let path = Bundle.main.path(forResource: "Disclaimer", ofType: "pdf") {
let url = URL(fileURLWithPath: path)
if let pdfDocum
我在一个文档目录中有本地的pdf文件。我的代码使用WKWebview或PDFViewer调用每个模拟器来显示,但它只在iPhone XR模拟器上显示,而不是在任何其他模拟器设备上显示。 任何比XR旧的设备都会显示一个错误: libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform. 带有XS、XS Max的设备,则显示以下错误: failed to open pdf ... 如代码中所示。 有人知道为什么吗? 我使用Xcode10.2。 下面是我用于WKWebview
我正试图创建一个PDF文件预览,这是由巴拉萨模型创建的。大约有50%的时间,我不会得到预览和xref丢失的错误。我做错了什么?
错误日志:
com.sun.pdfview.PDFParseException: Expected 'xref' at start of table
at com.sun.pdfview.PDFFile.readTrailer(PDFFile.java:974)
at com.sun.pdfview.PDFFile.parseFile(PDFFile.java:1175)
at com.sun.pdfview.PDFFile.<init>(
我目前在一个应用程序,应该可以显示和允许用户缩放PDF页面。因此,我选择了苹果的例子ZoomingPDFViewer。基本上,我理解示例代码。但有几行对我来说并不明显。
链接到示例代码:
在PDFView.m中:
//Set the layer's class to be CATiledLayer.
+ (Class)layerClass {
return [CATiledLayer class];
}
上面的代码是做什么的?
在PDFView.m中,我同样不理解第二个代码片段:
self = [super initWithFrame:frame];
if (self)
我有问题,创建一个渲染者在扎马林。
我试图在渲染器中显示另一个视图,但是它不能工作。我该怎么安排这个?对于如何设置这种渲染器,我感到困惑。protected override void OnElementChanged (ElementChangedEventArgs<PdfView> e)有必要吗?
我有一个这样的页面类:
public class PdfView : ContentView
{
}
public class PdfPage : ContentPage
{
public PdfPage (ProjectViewM