Search code examples
iospdfuigraphicscontext

iOS Drawing PDFs with UIGraphics: how to set document title?


I'm drawing a PDF using UIGraphicsBeginPDFContextToData and it's working fine except that the document is always Untitled. Is there a way to set the title metadata when using UIGraphics, or do I need to rewrite using CGPDFDocument?


Solution

  • Read this link here.

    The section on documentInfo refers to a dictionary you can pass in. In that dictionary, it contains a key for a title.

    Dictionary information.