5

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(){
        if let document = pdfContainerView.document{
            var attributes = document.documentAttributes
            attributes!["NewAttribute"] = "Test"
            document.documentAttributes = attributes
            savedocument(document)
        }
    }
Bobz
  • 140
  • 1
  • 8

0 Answers0