Geri Borbás
Geri Borbás

Reputation: 16588

Is there a way to write into a CGPDFDictionaryRef (PDFKit)?

I can see a lot of methods to get values, I can even nicely map out the entire PDF into a dictionary (see this thread).

But I could not find a way to write back into those dictionaries. I really just want to turn off a layer visibility. Just set a boolean to false at Catalog.Pages.Kids[pageIndex].Resources.Properties.MC(layerIndex).Visible, then save the PDF.

I can see that you can nicely read/write annotations (even with the higher-level PDFKit API).
But how do you edit the rest of the PDF contents (like above)?
Is it achievable at all with Apple PDFKit?

Upvotes: 2

Views: 182

Answers (1)

Leo Braun
Leo Braun

Reputation: 324

As far as I know, you can't.

You'll most likely need a (very) pricey commercial framework to do this.

You may also find some free open source frameworks that claim to be able to do this. For example, pdfio: https://github.com/michaelrsweet/pdfio

(My personal experience of using that framework wasn't successful though).

Upvotes: 0

Related Questions