SimplePDF icon indicating copy to clipboard operation
SimplePDF copied to clipboard

Adding checkboxes in PDF file

Open JorgeAGomez opened this issue 8 years ago • 1 comments

Is there a way of adding checkboxes?

Also can I add a string and an image besides the string?

Something like:

Do you want to participate? "Image or checkbox here"

JorgeAGomez avatar Aug 08 '16 22:08 JorgeAGomez

        let typeDetails = NSMutableAttributedString()
        
        let attachment = NSTextAttachment()
        attachment.image = Img.checked
        attachment.bounds = CGRect(x: 0, y: 0, width: 10, height: 10)
        let attachmentStr = NSAttributedString(attachment: attachment)


        typeDetails.append(attachmentStr)
        pdf.addAttributedText(typeDetails)

that would be the way it is done. but for whatever reason images are not accepted in attributed string here. trying to find a solution for the exact issue myself

davidseek avatar Nov 03 '17 21:11 davidseek