-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add a link within a title. #275
Comments
Apply 'HeadingN' paragraph style to TextRun or Link. Sample code: $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->addTitleStyle(1, array('size' => 16, 'bold' => true));
$phpWord->addTitleStyle(2, array('size' => 14, 'bold' => true));
$phpWord->addFontStyle('Link', array('color' => '0000FF', 'underline' => 'single'));
$section = $phpWord->addSection();
// Textrun
$textrun = $section->addTextRun('Heading1');
$textrun->addText('The ');
$textrun->addLink('https://github.com/PHPOffice/PHPWord', 'PHPWord', 'Link');
// Link
$section->addLink('https://github.com/', 'GitHub', 'Link', 'Heading2'); |
Thank you, this probably should be an example somewhere in the docs. Works perfectly. |
You're right. I think this suites well for the |
Recipe added: e9f8e88 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there is a work around, I have not been able to find it.
Thanks.
The text was updated successfully, but these errors were encountered: