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
2
votes
0 answers

Adjust first page offset in PDFView

I'm trying to build a small pdf viewer with PDFKit. To achieve a parallax effect, I constrained the PDFView to the superview instead of the safe-area. Unfortunately the PDFView has the wrong offset inside it's ScrollView. My idea: There should be a…
Ben K
  • 21
  • 4
1
vote
0 answers

Writing images to PDF using PDFKit in Swift results in blurry images

I have the following classes: import Foundation import PDFKit import SwiftUI struct PDFPreviewView : View { @State private var showShareSheet : Bool = false var pdfData: Data? { LabelPDFCreator().pdfData() } var…
1
vote
0 answers

PDF Page external links ( hyperlink) are not working after rendering PDF content to UIView in Swift iOS

The pdf that has external weblink on the first page for accessing they youtube. When i open it pdf of reader or other apps it will be asked open the youtube. I want to support that functionality in UIView level. I copied PDF content to UIView…
1
vote
0 answers

How to export a View in multiple A4 PDF pages?

I have been trying to find a way to export a View in SWIFTUI in A4 size pages PDF. The view cannot fit in one single page. So far I have managed to edit (with the help of ChatGPT) the code found in PDF Creator GitHub (See below) But although I get…
Ioannis
  • 21
  • 3
1
vote
0 answers

How can I prevent my PKCanvas PDFOverlay object from becoming blurry when pinch-zooming in on a PDF in iOS?

I got the code presented in WWDC2021 to work and im able to overlay a PencilKit Canvas object over each pdf page. When starting the app, a pdf is shown and the overlayed PKCanvas looks as expected. When pinch-zooming in on the pdf, the PKCanvas gets…
1
vote
0 answers

iOS PDFKit Cryptograhpic Signature

How can you cryptographically sign (ECDSA) a PDF on iOS with Apple's PDFKit and save it in the PDF file? From the framework intro one would expect to find most of the PDF spec features implemented, but I struggle to find anything about cryptographic…
shutteltje
  • 51
  • 5
1
vote
1 answer

Is there any way where we can get the current page number in PDFView and use it in SwiftUI

I am making an app pdf reader using PDFKit but I am unable to get the current page number. I can get the total pages by pdfView.document?.pageCount. The alternative way we can use for this is to change the page by button and count it but I want the…
1
vote
0 answers

Unable to move annotation with PDFKit

By following this reference - https://developer.apple.com/documentation/pdfkit/pdfannotation/2869800-isreadonly I am able to edit text of the annotation but i am unable to move the annotation over the pdf page. Is there any other property by using…
1
vote
1 answer

Swift PDFKit draw multiple images in a single PDFPage

I'm trying to draw multiple images into a single PDFPage. Looking at the docs and over StackOverflow seems like the best I got is to use PDFPage with an UIImage initializer like so: let pdfPage = PDFPage(image: image) But it just creates a page…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
1
vote
1 answer

How to set PDFPageOverlayViewProvider for PDFView?

[UPDATED] I'm trying to set a pageOverlayViewProvider for a PDFView and it does not work as expected. PDFPageOverlayViewProvider methods are not being called, PDFViewDelegate methods are working fine. struct ReaderView: UIViewRepresentable { …
Pavlo
  • 13
  • 3
1
vote
0 answers

Memory issues with PDFKit when merging pdf documents

I'm trying to merge several PDF documents. Some of them can be quite large. In some cases my app crashes due to memory pressure. the autoreleasepool doesn't seem to work either. Is there something wrong with my code ? func combinePDFs(urls: [URL])…
Aymarick
  • 533
  • 2
  • 11
1
vote
2 answers

Make a pdf document by Image using PDFKit in iOS 16

while we make a pdf using an image file at that we add an image into PDFPage. at that time PDFDocument did not show the original image content in PDFView in iOS 16. I checked the same code which worked properly in iOS 15. For both test cases, I used…
1
vote
1 answer

Resize and Rotate image Annotation added in pdf

Using this Link I have added signature image annotation in PDF file But i could not find any guide for how to rotate and resize image annotation using the button added on top of annotation image like shown in the image. What i want to do is: want…
user2201
  • 29
  • 7
1
vote
0 answers

PDFPage thumbnail (UIImage) does not respect PDFPage orientation in iOS 13 (Xcode 13.1)

Description I am having issue with UIImage "generated" from PDFPage via method .thumbnail(of:for). UIImage, which I later display in UIImageView, does not respect rotation of the PDF page, in iOS 13 only. When PDF page is rotated for example by 90°…
peetadelic
  • 104
  • 5
1
vote
0 answers

Saving a PDF file to application documents folder, swift iOS

I am using PDFKit to make changes to annotations on a PDF file in an iOS application. When I try to save the file, I am getting no errors and the path looks correct, the print statement returns…
1 2 3
8 9