Replies: 2   Views: 932
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 anilkumar  · 07-09-2020 - 07:36


I am using some urls in text field of word docx, but when I convert word to pdf using "transformPdf". The links are trucating when i hover the mouse on the link.

Issue in detail: the links look fine but when I place mouse over the link it show/redirect me to the truncated link. Furthermore, when i performed some sort of testing then I found out that, if the text field(text box/cell in word docx) is small and link scattered over 4-5 lines, then if I mouse over the link, PDF is only considering 1 or 2 lines of link that's why it feel trucated. 

But when I expanded the text field (box/cell) so that the link should be on the one line only. then it worked fine, it showed me full and redirected me to the specified correct link.

I can provide you both PDF documents, but I'm not seeing any field to attach or upload them.

Note: I'm using advanced package.


Posted by admin  · 07-09-2020 - 07:52


There's no known issue when working with links and transforming DOCX to PDF.

Please send to contact[at] the username or email of the user that has purchased the license you are using, the DOCX you are transforming and the PDF you get.


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


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'=> '',
    '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.