Menu

#71 External and internal links, local and remote

Unstable_(example)
closed
nobody
None
1
2014-05-22
2014-05-20
No

On top of patch 69, I found some more code to change to make everything work a little bit more smoothly:

Search for this piece of code (lines 8333+8334 in version 6.0.36)

=== FIND ===
// external URI link
$annots .= ' /A <_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>';
=== /FIND ===

and substitute with

==== REPLACE ====
$parsedUrl=parse_url($pl['txt']);
if(empty($parsedUrl['scheme']) and strtolower(substr($parsedUrl['path'],-4))=='.pdf') {
// relative link and PDF file with mabe a named destination!
$dest='';
if(!empty($parsedUrl['fragment'])) {
$tmp=explode('=', $parsedUrl['fragment']);
$dest=' /D ('.(count($tmp)==2 ? $tmp[1] : $tmp[0]).')';
}
$annots .= ' /A << /S /GoToR'.$dest .' /F '.$this->_datastring($this->unhtmlentities($parsedUrl['path']), $annot_obj_id) . ' /NewWindow true>>';
} else {
// external URI link
$annots .= ' /A << /S /URI /URI '.$this->_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>';
}
==== /REPLACE ====

Discussion

  • Nicola Asuni

    Nicola Asuni - 2014-05-22
    • status: open --> closed
     
  • Nicola Asuni

    Nicola Asuni - 2014-05-22

    OK. I have added this patch to TCPDF 6.0.081 with some modifications.

     

Log in to post a comment.