Ruslan  Allabergenov
Ruslan Allabergenov

Reputation: 97

phpword work with addlink within msword

It is possible add link within msword document on PHPWORD? I want to add link each sheet of msword document. And this link forwarded to top of the document (1-page document). If it is possible, can we will write examples?

Upvotes: 1

Views: 1397

Answers (1)

ejuhjav
ejuhjav

Reputation: 2710

PhpWord samples are a good starting place to look for things: there is a simple example available at phpword github samples that shows how this is done.

A simplified example how to use the internal links:

// adding an internal bookmark
$section->addBookmark('MyBookmark');

// adding a link to the internal bookmark
$section->addLink('MyBookmark', htmlspecialchars('Take me to the first page', ENT_COMPAT, 'UTF-8'), null, null, true);

Upvotes: 1

Related Questions