Forum


Replies: 2   Views: 1584
Urls are not working in pdf (text box/cell)
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 08-09-2020 - 14:20

Hello,

Thanks for sending the requested documents. We have checked them and the problem is that LibreOffice needs a character style (rStyle) when the link is truncated in a cell table.

If you are using addLink (standalone or add as a WordFragment) you can set a character style (w:rStyle, such as DefaultParagraphFontPHPDOCX  included in phpdocx or a custom one using createCharacterStyle) running:

$linkOptions = array(
    'url'=> 'http://www.google.es',
    'rStyle' => 'DefaultParagraphFontPHPDOCX'
);
$docx->addLink('Link with a custom character style', $linkOptions);

Adding a custom character style to the link, the hyperlink will appear correctly when transforming the DOCX to PDF a truncate text inside a cell table. HTML to DOCX also allows setting a custom character style to contents.

Regards.