Menu

Long wrapped links get cutoff

Help
Mike
2014-12-17
2014-12-18
  • Mike

    Mike - 2014-12-17

    Thanks for a great library and all the work you've put into it. I'm not sure if I've hit a bug or not. If got a pdf document that is serving as input and stamp it with footers, etc. However, I recently noticed that links that are too long to fit on one line get cut off at the point where it wraps to the next line. Does this sound like a bug or user error? These links do work in the source pdf. Thanks!

     
  • cpw

    cpw - 2014-12-18

    Does this sound like a bug or user error?

    Depends on what exactly you're doing. In case you're using addHtmlLink it sounds as if you've set the "firstline"-parameter to "true":

    require('/tcpdf/tcpdf.php');
    
    $pdf = new TCPDF($orientation = "P", $unit = "mm", $format = "A4", $unicode = true, $encoding = 'UTF-8', $diskcache = false, $pdfa = false);
    
    $pdf->SetPrintHeader(false);
    $pdf->SetPrintFooter(false);
    
    $pdf->SetDisplayMode(100, "OneColumn");
    
    $pdf->SetMargins($left = 23.0, $top = 11.0, $right = 17.0, false);
    
    $pdf->AddPage("P", "A4");
    
    $pdf->addHtmlLink($url="http://www.example.com/0123456789a0a1a2a3a4a5a6a7a8a9b0b1b2b3b4b5b6b7b8b9c0c1c2c3c4c5c6c7c8c9d0d1d2d3d4d5d6d7d8d9", $name="http://www.example.com/0123456789a0a1a2a3a4a5a6a7a8a9b0b1b2b3b4b5b6b7b8b9c0c1c2c3c4c5c6c7c8c9d0d1d2d3d4d5d6d7d8d9", $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false);
    
    $pdf->Ln();
    $pdf->Ln();
    
    $rest = $pdf->addHtmlLink($url="http://www.example.com/0123456789a0a1a2a3a4a5a6a7a8a9b0b1b2b3b4b5b6b7b8b9c0c1c2c3c4c5c6c7c8c9d0d1d2d3d4d5d6d7d8d9", $name="http://www.example.com/0123456789a0a1a2a3a4a5a6a7a8a9b0b1b2b3b4b5b6b7b8b9c0c1c2c3c4c5c6c7c8c9d0d1d2d3d4d5d6d7d8d9", $fill=false, $firstline=true, $color='', $style=-1, $firstblock=false);
    
    $pdf->Output();
    

    The first link (firstline=false) will wrap to the next line if there's no more horizontal space left, the second link (firstline=true) will just stop outputting and return the rest of the string ($rest in my example). Also see http://www.tcpdf.org/doc/code/classTCPDF.html#af26dfbff2e1507f87a2fae64eebe08e1

     

Log in to post a comment.