Tuesday, 12 January 2016

How to put HTML data into header of tcpdf

As @vinzcoco says, you must extend TCPDF to achieve what you want. Here is a simple improvement that I think it could be useful for you: class MyTCPDF extends TCPDF { var $htmlHeader; public function setHtmlHeader($htmlHeader) { $this->htmlHeader = $htmlHeader; } public function Header() { $this->writeHTMLCell( $w = 0, $h = 0, $x = '', $y = '', $this->htmlHeader, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = 'top', $autopadding = true); } } Now,...

PHP Equvilent base64_encode with javascript code

<script type="text/javascript"> function base64_encodeRsync (data) {   var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";   var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,     ac = 0,     enc = "",     tmp_arr = [];   if (!data) {     return data;   }   do { // pack three octets into four hexets     o1 = data.charCodeAt(i++);     o2 = data.charCodeAt(i++);     o3 = data.charCodeAt(i++);     bits = o1 <<...