iOS/iPadOS 17.2 Bug in PDFKit duplicates content of filled PDF form fields

The following situation is given:

In your code you have a PDFDocument object. This contains a PDF file with form fields that are filled with text.

If you call the dataRepresentation() method on this PDFDocument object, you get back a data object:

let myDocumentData: Data = pdfDocument.dataRepresentation()!

If you now want to initialize a new PDFDocument object with this data object, the contents of the form fields are duplicated within the PDF.

let newPDF: PDFDocument = PDFDocument(data: myDocumentData)

If you now want to print the newPDF PDFDocument object by creating a new print job, you will get the following result:

What you actually expect to see:

You only see this behavior when you want to print or share the PDF. You won't see this behaviour inside a PDF View in your application.

This behaviour only appears since iOS/iPadOS 17.2

Steps to reproduce:

  1. Get a PDF file with form fields, especially text fields
  2. fill out these text fields with text
  3. create a PDFDocument object with this PDF file
  4. call the dataRepresentation() method on this PDFDocument object and store the result in a new variable
  5. create a new PDFDocument object with the data object created in the previous step:PDFDocument(data: <data>)
  6. Print the new created PDFDocument within iOS/iPadOS 17.2 or share it for example via email

I hope Apple will fix this bug soon!

Any luck finding some workaround that?

Were you able to solve this problem?

Were you able to find the solutions. We are also getting the same issue.

I have the same issue on IOS 17.2.1

@Johnny44 Did you find any solution for this?

This is still happening. Did you find any solutions?

Still an issue today in iOS 18.4.1. No solution aside from having people open the PDFs in another app like Adobe Acrobat where it can fill PDF forms properly but we can't expect users we don't know to do this. I cannot reproduce this with MacOS 15.0 (but I do need to update). The detail properties of the documents says that the iOS version is using PDF version 1.4 (Acrobat 5.x) and the MacOS version is using PDF version 1.3 (Acrobat 4.x) if that helps anyone with solving this issue.

iOS/iPadOS 17.2 Bug in PDFKit duplicates content of filled PDF form fields
 
 
Q