signDOCX

sign (for DOCX files)

PREMIUM TRIAL / ADVANCED

Digitally signs a Word document.

DIGITAL SIGNATURE PACKAGE

Description
public sign ()

This method allows you to digitally sign a Word document.

You may find a detailed description of the digital signature process in the Digital Signature section of our API documentation.

Parameters

This method takes no parameters.

Exceptions

Error while trying to open the (base) template as a zip file.

The file does not exist.

Unable to find a private key.

Unable to find a certificate.

Code samples

Example #1

The resulting Word document looks like:

Release notes
  • phpdocx 14.0:
    • avoid generating partial signed files in the latest revisions of MS Office.
    • return DOCXStructure.
  • phpdocx 12.0:
    • replaced phpseclib with OpenSSL.
    • replaced exit methods by exceptions.
  • phpdocx 7.5:
    • supported adding multiple signatures.