Questions tagged [apple-pdfkit]

Questions related to the Apple PDFKit framework.

Questions related to the Apple PDFKit framework (https://developer.apple.com/documentation/pdfkit).

57 questions
378
votes
3 answers

Fast and Lean PDF Viewer for iPhone / iPad / iOS - tips and hints?

There has been many Questions recently about drawing PDF's. Yes, you can render PDF's very easily with a UIWebView but this cant give the performance and functionality that you would expect from a good PDF viewer. You can draw a PDF page to a…
Luke Mcneice
  • 3,012
  • 4
  • 38
  • 50
9
votes
4 answers

iOS PDFKit adjust pdf frame in PDFView

I have a PDF that has pages of different heights that I want to display in a horizontally paged fashion, one page at a time, with no gaps between pages, and the top of each page being aligned with the top of the view. For example: I would like to…
Clay Ellis
  • 4,960
  • 2
  • 37
  • 45
9
votes
2 answers

PDFKit Swapping Content of Annotation

Can the text (i.e. contents) of a FreeText annotation be changed in PDFKit without deleting an annotation / building a new annotation? The following snippet does not change an annotation's contents when viewing in a PDFView: let url =…
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
5
votes
1 answer

Custom UIMenuItem not working on PDFKit's PDFView

I'm trying to add a custom UIMenuItem to my PDFView Here's what I'm doing in my sample Xcode project #import #import #import "ViewController.h" @interface ViewController () @property(nonatomic) PDFDocument…
HotBread
  • 51
  • 3
4
votes
2 answers

Create pdf with WKWebView.pdf(configuration:)

I want to create a pdf on macOS with the new WKWebView.pdf(configuration:) which was introduced in macOS 12/iOS 15. It tries to make use of the new async/await functionality (which I most likely have not grasped entirely I am afraid...). Right now,…
appfrosch
  • 1,146
  • 13
  • 36
4
votes
0 answers

How to resize or move PDFAnnotation inside PDFPage?

I am developing a PDF app using PDFKit (Swift). I have successfully implemented functionality to add drawing into the PDF file using PDFAnnotation subtype Ink. Now, the next step is to make that PDFAnnotation resizable and movable inside the PDF…
Sac Allen
  • 61
  • 3
4
votes
2 answers

How to remove PDFDocument margin

I add pdfdocument to the PDFView . but it is showing margin and also showing in the canter. How to remove this margin . And Is there any way to set pdfdocument to the top-left position.
Spanix Dev
  • 101
  • 6
4
votes
1 answer

PDFKit / PDFView Disable Interaction with Form Annotation

For a PDFDocument that contains annotations with a widgetFieldType of PDFAnnotationWidgetSubtype.text and PDFAnnotationWidgetSubtype.button is it possible to disable user interaction for those annotations (i.e. clicking on a checkbox does not cause…
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
4
votes
1 answer

Can I add PDFView through Storyboard in iOS 11

I am creating a PDF reader kind of App and for that, I am using PDFKit to show PDF files in that app. I am able to add PDFView through code and it's working fine. But is it possible that I can add PDFView through storyboard and then by Outlet I will…
CodeChanger
  • 7,953
  • 5
  • 49
  • 80
3
votes
3 answers

Edit and save existing pdf documents in iOS using Swift 5 - PDFKit

I have been trying to edit an existing pdf file and saving it to device. I have tried saving the edited file to the same location as the unedited one. But the file could not be saved. Instead I got errors like Attempting to save dictionary with…
Koushik Mudi
  • 183
  • 1
  • 12
3
votes
0 answers

transparent background color in PDFView no more working from Mac Catalyst 13.0+

In a MacOS app, I was using a classic PDFView with a transparent background with a simple: pdfViewer.backgroundColor = .clear All was working like a charm in Mojave but from the Catalina update I really can fix it. Perhaps it is a bug in relation…
ek88
  • 51
  • 4
3
votes
1 answer

PDFKit bug, need to disable UIMenuItems

I am trying to disable UIMenuItems in PDFKit. I have implemented override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { return false } But MenuItems Copy and Select All are still active. The main reason I want…
hidden-username
  • 2,610
  • 3
  • 14
  • 19
3
votes
0 answers

Unable to save PDF annotations

My mission seems simple. Change the text value of an existing annotation and save it under a new file name (even the same file name would be progress). I've successfully changed the annotation (verified by printing to the log immediately after…
Vegepilot
  • 98
  • 1
  • 8
3
votes
0 answers

PDFDestination is not giving me the right information (Apple PDFKit)

I've got a PDF file of a technical drawing that contains one page with bookmarks linking to specific areas of the document. When I click those bookmarks in Adobe Reader or Foxit Reader, it zooms to this specified area. But in Apple's Preview.app or…
heyfrank
  • 5,291
  • 3
  • 32
  • 46
3
votes
1 answer

Add a footer like "page x of y" when creating a PDF using UIGraphicsPDFRenderer

I'm working on a function in my app that lets users export their data into a nicely designed PDF. I'm using UIGraphicsPDFRenderer for this and I went through Apple's documentation. I'm having a problem adding a footer like "page x of y". While "x"…
Chris
  • 107
  • 1
  • 10
1
2 3 4