addLineSignature

addLineSignature

PREMIUM TRIAL / ADVANCED

Inserts line signatures into a Word document.

Description
public addLineSignature ( array $options )

This method inserts a line signature into your Word document.

Parameters

options

The possible keys and values are:

Key Type Description
altText string Alternative text. 'Microsoft Office Signature Line...' as default.
height int In points. 96 as default.
signerInstructions string Signer instructions.
suggestedSigner string Suggested signer.
suggestedSignerEmail string Suggested signer email.
suggestedSignerTitle string Suggested signer title.
width int In points. 221 as default.
Exceptions

Method not available.

Code samples

Example #1

x
 
1
require_once 'classes/CreateDocx.php';
2
3
$docx = new CreateDocx();
4
5
$docx->addText('Empty line signature:');
6
$docx->addLineSignature();
7
8
$docx->addText('Line signature with signature information:');
9
$docx->addLineSignature(array('suggestedSigner' => 'John Doe', 'suggestedSignerTitle' => 'Tech editor', 'suggestedSignerEmail' => 'jdoe@mail.com', 'altText' => 'Custom alt text', 'signerInstructions' => 'Custom instructions'));
10
11
$docx->addText('Line signatures added in the same paragraph:');
12
$lineSignatureFragmentA = new WordFragment($docx);
13
$lineSignatureFragmentA->addLineSignature(array('suggestedSigner' => 'John Doe', 'width' => 140, 'height' => 100));
14
15
$tabFragment = new WordFragment($docx);
16
$tabFragment->addTab();
17
$tabFragment->addTab();
18
19
$lineSignatureFragmentB = new WordFragment($docx);
20
$lineSignatureFragmentB->addLineSignature(array('suggestedSigner' => 'Jane Doe', 'width' => 140, 'height' => 100));
21
22
$contents = array();
23
$contents[] = $lineSignatureFragmentA;
24
$contents[] = $tabFragment;
25
$contents[] = $lineSignatureFragmentB;
26
27
$docx->addText($contents);
28
29
$docx->createDocx('output');
30

The resulting Word document looks like:

Release notes
  • phpdocx 16.0:
    • use EMF as default image.
    • generate and add a GUID as id.
  • phpdocx 14.5:
    • new method.
­
­