#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    399
    Rep Power
    190

    Create a signed PDF via PHP


    I am looking for the tools I can use to create a signed PDF, on the fly. I am not asking for anyone to do it for me, but at least point me in the right direction.
    Thomas Tremain
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    158
    Rep Power
    98
    By sign you mean you want an image of a signature added to an already existing PDF?

    This should get you started.

    http://us3.php.net/manual/en/function.pdf-open-pdi.php

    Next you're going to want to load an image to add it to the document.


    ...I suspect you're talking about digital signatures.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    399
    Rep Power
    190
    Originally Posted by WrinkledCheese
    By sign you mean you want an image of a signature added to an already existing PDF?

    This should get you started.

    http://us3.php.net/manual/en/function.pdf-open-pdi.php

    Next you're going to want to load an image to add it to the document.


    ...I suspect you're talking about digital signatures.
    Sorry, I wasn't clear. Yes, I mean a digital signature, requiring a digital certificate.
    Thomas Tremain
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    158
    Rep Power
    98
    It seems you would use PDFlib functions to attach the signature fields to the PDF:

    http://www.planetpdf.com/forumarchive/114124.asp

    Please note that this link points to seemingly broken code, but it's a place to start.
  8. #5
  9. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    There is a pure PHP PDF library, fpdf which does not reply on the pdflib library, here's the manual page for inserting an image

    http://www.fpdf.org/en/doc/image.htm

    The site is poorly designed (it uses frames), so here's a link to the main page http://www.fpdf.org to give you a little more context
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    158
    Rep Power
    98
    Northie: Can he set the appropriate fields in the PDF in order to have it validate against his digital certificate?
  12. #7
  13. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    Originally Posted by WrinkledCheese
    Northie: Can he set the appropriate fields in the PDF in order to have it validate against his digital certificate?
    Is this not handled by the https protocol by which the document is requested? or am I misunderstanding your question?

    EDIT

    I'm talking about images not digital certificates.....call me naive, but what is a signed PDF and how is it different from an unsigned one?
    Last edited by Northie; August 1st, 2013 at 11:40 AM.
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    158
    Rep Power
    98
    It has the same attributes as a certificate.

    http://blogs.adobe.com/security/Samp...DFDocument.pdf

    If you follow the link I posted above it shows someone trying to digitally sign the PDF using PDFlib, which I suspect it what he wants.

    The certificate signs the file rather than the protocol it's passwd over.

    I think it's the same idea when you install a Windows application and Windows says "this is not a trusted application" because it was not digitally signed by a trusted CA certificate.

    If you look at the features comparison of the SDKs available form Adobe, it shows that it is possible.

    http://www.adobe.com/devnet/pdf/library.html
  16. #9
  17. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    506
    Rep Power
    128
    Call me naive as well, but isn't the purpose of signed PDFs to avoid automated processes?

    Seems like it'd be like a secretary rubber-stamp-signing documents for their employer. If the form only cared about the secretary seeing it then it would just ask for the secretary's signature. A form requesting someone's signature is sort of expecting that person to see and acknowledge its contents.

    So when I first saw PDF signing and how a PDF can't be changed after being signed, I sort of assumed the idea was specifically to have an enforced and secure manual process.
    LinkedIn: Dave Mittner
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    158
    Rep Power
    98
    It's to authenticate the origin.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    399
    Rep Power
    190
    The web site will generate a PDF (let's call it a COA or certificate of authentication) for an item, and will include a photo of that item.

    Think of it like a promise from our company (domain name) that this item is what we say it is, and the PDF could even be passed to another party later.

    Even if given to another party, it is still digitally signed by us, and cannot be altered or recreated... Copied yes, but not altered.

    Since the "Item" I am referring to is an animal, and the sheet will include a genetic pedigree, and a photo, we would be certifying that this pedigree is a promise by us, that the animal in the photo, has the genetics promised.

    This will prevent someone from making up something fake, (like changing a photo) and passing it off as ours.

    When we sell the animal, we cam email a copy of the pedigree to the new buyer, and in the PDF pedigree it will specifically tell how to check the digital signature... (like how they tell you on some checks to look for the watermark or other security features.)

    So the digital signature is NOT a graphic, it is to certify who created the document, and that it has not been altered.
    Thomas Tremain

IMN logo majestic logo threadwatch logo seochat tools logo