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
1
vote
1 answer

How to highlight selected text in pdf using PDFKit?

I have set up a PDFViewer and would like to add a highlight functionality so that when a user selects text, they could highlight it. When you highlight text in notes, iMessages etc. you have the option to select all, copy, paste etc. How would you…
1
vote
1 answer

Swift PDF render any UIView or UIViewController PDFKit

I made some research, I found that I can draw Image, Strings, Shapes with the PDFKit library. Is there any easy way to draw a UIView or the view of a UIViewController inside the PDF document? I prefer a Swift answer, but I will accept Objective-C…
4bottiglie
  • 523
  • 7
  • 22
1
vote
2 answers

How to colour link annotation or add action to highlight annotation using PdfKit in swift

I have some pdf's in my application and am using PdfKit in swift. Now i want to highlight all the hyperlinks in a pdf document. I tried using PDFAnnotationSubtype.highlight and PDFAnnotationSubtype.link but in both cases i could not achieve my…
Mak13
  • 330
  • 3
  • 14
1
vote
0 answers

Text Cursor out of view when typing

I have multiple PDFKit annotations added into my PDF Document. When the user selects the text annotations to add text, the keyboard appears and the document scrolls upward and the cursor is no long on the screen. I have tried treating the PDF…
voodoo
  • 109
  • 9
1
vote
1 answer

Filling out a PDF document with information from UITextField

I have a PDF document stored in the main bundle of my app and a ViewController with text fields for user input. I also have a button to email the filled out PDF to the user. I do not need to save the PDF to the device I would like to use PDFKit to…
J. Wood
  • 43
  • 4
1
vote
1 answer

Unable to save pdf form data using PDFKit iOS 11

I have loaded a pdf form using PDFKit in iOS 11. I am trying to save the editable fields ( Checkbox, TextBox) values. How do I get back the editable PDFDocument object to save the PDF contents using (BOOL)writeToFile:(NSString *)path;
AAN
  • 31
  • 6
1
vote
1 answer

macOS/iOS PDFKit: create document's outline root

The following example code allows to add an outline (or "bookmark" in Acrobat's terminology) to a existing PDFDocument pdfDoc with label Page n pointing to page number n where n is the passed argument pageNum. void insertOutline( PDFDocument…
Paolo
  • 15,233
  • 27
  • 70
  • 91
1
vote
3 answers

How to present a single page pdf document in PDFView so that the document is centred and fully presented?

I have an application that takes a photo of a document and then presented as a pdf in PDFView in a new UIViewController. The problem that I am having is that when the pdf document is presented, it is some what zoomed in and the PDFView does not…
dean
  • 321
  • 3
  • 17
1
vote
0 answers

How to highlight text in pdf using PdfKit

I am creating app where i need to load the pdf file from document directory and need to highlight text manually by user. Also we need to export the updated pdf file and upload it to the server. Is there any way to manage the same using pdfkit…
SULEMAN BAWA
  • 75
  • 10
1
vote
2 answers

PDFView unable to move to nextpage

Code: if let path = Bundle.main.path(forResource: "test", ofType: "pdf") { let url = URL(fileURLWithPath: path) if let pdfDocument = PDFDocument(url: url) { pdfView.displayMode = .singlePage …
karthi
  • 31
  • 1
  • 8
0
votes
0 answers

PDFKit - PDFPage.characterBounds(at: Int) returns wrong character bounds with iOS 17 beta 5

Apple's PDFKit function PDFPage.characterBounds(at:) returns wrong character bounds running iOS 17 beta 5 / Xcode 15 beta 6 while returning correct data running iOS 16 (or earlier). Has anybody experienced the same issue and/or has found a…
KlausM
  • 193
  • 12
0
votes
0 answers

Using PDFKit and swift I can seem to place the header on the top of the table, the header always goes to the bottom

I have a GenerateExpenseReportViewController class to generate a PDF report based on an array of expenses retrieved from a DBManager. The PDF is generated using PDFKit and the contents of the report are laid out in a table format. The table contains…
0
votes
0 answers

How to Programmatically fill PDF form field using SwiftUI and PDFKit?

I'm trying to make a program that assigns the value of a variable to a PDF field. For example, a variable "name" fills the name field in my PDF and at the end of everything download the file. I tried using PDFKit and PSPDFKit but I'm not succeeding.…
0
votes
1 answer

Can we get click or tap event and change color of PDFAnnotation with having image on it

I am trying to add pdfannotation inside pdfview with image only, where I need tap event of that particular iamge annotation that I have added. Can anyone suggest any way to achieve this. because I need specific tap or selected event of that. so…
Akash S
  • 17
  • 7
0
votes
0 answers

Modifying a PDF in iOS

I am trying to modify a pdf. This program Creates a simple PDF when ViewDoesLoad. That works. Then, when the button is pressed, I reload the PDF, and try and write additional text to it and then save it. However the the modified PDF is Identical…
RW.
  • 637
  • 6
  • 14
1 2 3
8 9