Questions tagged [ios-pdfkit]

This tag should only be used for questions related to PDFKit which is available for iOS as of iOS 11.0 and macOS as of 10.4.

PDFKit is a framework for iOS and macOS. Display and manipulate PDF documents in your applications.

131 questions
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
5 answers

Detect that a PDFView did scroll

Does PDFKit on iOS expose a PDFView's underlying UIScrollView or is there any other way to directly detect that the user has scrolled a PDFView? My use case is to hide a nav bar when the document is scrolled so as a workaround I've added my own pan…
Michael Behan
  • 3,433
  • 2
  • 28
  • 38
7
votes
0 answers

How to handle a crash caused by a memory leak while using a PDFKit in iOS 12?

I am using pdfKit on CollectionViewController and each cell has a different PDF for it, and PDF will be downloaded from the document directory. When I use the following code under iOS 11 then it works fine. However, when I use it on iOS 12, I get a…
6
votes
3 answers

How to get rid of "Highlight" context menu item in PDFView?

I'm using PDFKit to render a PDF and I have added custom menus using "UIMenuController". But it is now deprecated from iOS 16 onwards. I remove share、lookup menu items with code below: @available(iOS 13.0, *) open override func buildMenu(with…
Phil
  • 201
  • 1
  • 7
6
votes
5 answers

Add a tap gesture recognizer to PDFView in iOS 13

My code works in iOS 12. But after upgrading to iOS 13, it does not work. let pinPointRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.pinPoint(sender:))) pinPointRecognizer.numberOfTapsRequired =…
ysong4
  • 131
  • 1
  • 9
6
votes
1 answer

How do you extract images from PDF using Swift?

I understand PDFKit allows extracting text+formatting as NSAttributedString, but I can't find any info on extracting each individual figures from any PDF document using Swift. Any help would be greatly appreciated, thanks! edit:…
Debee
  • 61
  • 1
  • 6
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
5
votes
0 answers

iOS PDFkit cannot add custom attribute to pdf document

I am trying to add custom attribute to a pdf document metadata, but after savedocument(document) the custom attribute is not added to the document. @IBOutlet weak var pdfContainerView: PDFView! private func setDocumentAttributes(){ …
Bobz
  • 140
  • 1
  • 8
4
votes
0 answers

Disable Automated PDF Analysis in iOS 16 PDFKit

Since the upgrade to iPadOS 16, Xcode's console has been filled with messages such as [VKImageAnalyzer processRequest:] returned 0 or [VKImageAnalyzer processRequest:] block returned NULL analysis - this happens in the simulator, and on the physical…
Ron Regev
  • 459
  • 2
  • 18
4
votes
0 answers

Replace image(s) in PDF in swift. How to get image position in page?

I need to replace images in a PDFDocument or CGPDFDocument. I found a way to extract images using the old Core Graphics API (i.e. not PDFKit). Here. Now I would like to make a copy of a PDF but by replacing the existing images. How can I get the…
vomi
  • 993
  • 8
  • 18
4
votes
2 answers

iOS PDFView causes underlying assertion when autoScales is set to true

Im working on an application that needs to display a pretty large PDF file. I'm using PDFKits PDFView for this, which is then wrapped in a UIViewRepresentable. The problem is that when setting PDFView.autoScales = true i get an error on startup. The…
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

How can you remove highlighted pdf annotations?

I've set up a search bar in my pdf view and can highlight the words I'm looking for. When I try to remove the highlights so that I can search for new words. I've tried to reverse what I did, change the color to white, and remove annotations yet…
3
votes
1 answer

Converting images to A4 size pdf using swift

I want to convert a UIImage array to a pdf file. PDF file page size should be A4. I tried with PDFKIT but the result is not appropriate. What I want: A4 page size Image should be centered and scaled on the page(Array Images dimension is not…
1
2 3
8 9