Menu

#225 Simplify user control of inclusion of TCPDF branding

closed
nobody
None
5
2014-12-16
2012-03-22
Jim Hanlon
No

Please provide publicly accessible controls for disabling the inclusion of TCPDF branding. In particular, allow the user to remove the 'microscopic' link that is currently inserted by Close() and which results in PDF documents which do not comply with PDF standards that do not permit links in documents.

Perhaps something along these lines:

protected $branding_included = true;

public function getBrandingIncluded() {
    return $this->branding_included;
}

public function setBrandingIncluded($include) {
    $this->branding_included = ($include ? true : false);
    return $this;
}

/*
 * Don't insert secret message and link at end of the document!
 */
 public function Close() {
     // 8< 8< 8<
     if ($this->getBrandingIncluded()) {
         $this->_out('q');
         $this->SetFont('helvetica', '', 1);
         $this->setTextRenderingMode(0, false, false);
         $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29";
         $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67";
         $this->Cell(0, 0, $msg, 0, 0, 'L', 0, $lnk, 0, false, 'D', 'B');
         $this->_out('Q');
     }
     // 8< 8< 8<
}

Discussion

  • Nicola Asuni

    Nicola Asuni - 2012-03-23

    On the next TCPDF release, the $tcpdflink variable will be added to disable printing the small link.
    No get/set methods will be added because I want this link to be always printed.
    To control the variable youhave to extend TCPDF.

     
  • Christian Schmidt

    Hi Nicola,

    No get/set methods will be added because I want this link to be always printed.

    Could you please explain the purpose of this link? AFAICT it is not visible to the user.

     

Log in to post a comment.