This is an archived forum post. The information may be outdated. Contact us if you have any questions.
$header = ' <!doctype html> <html> <head> <meta charset="UTF-8"> <title>'.$page_details->post_name.'</title> <link rel="stylesheet" type="text/css" media="all" href="'.$uri.'/style.css" /> </head> <body> <div class="pdf_header"> </div> </body> </html>'; $client->setHeaderHtml($header);
$output = '<!doctype html> <html> <head> <meta charset="UTF-8"> <title>'.$page_details->post_name.'</title> <link rel="stylesheet" type="text/css" media="all" href="'.$uri.'/style.css" /> <script type="text/javascript" src="//use.typekit.net/nsr3bkh.js"></script> <script type="text/javascript">try{Typekit.load();}catch(e){}</script> </head> <body> <div class="custom_pdf"> content </div> </body> </html>';
.custom_pdf { width:500px !important; background:red; height:250px; } .pdf_header { width:500px !important; background:blue; height:250px; }
$client->setPageWidth("8.5in"); $client->setPageHeight("11in"); $client->setPageMargins(".5in", ".25in", ".5in", ".25in"); $content = "<body style='margin:0;padding:0;background-color:#eee'> <div style='height:100%;border-left: 1px solid #777;border-right: 1px solid #777;'> Content </div> </body>"; $header = "<div style='background-color:#ddd;margin-top:10px;height:100%;border-top:1px solid #777;border-left:1px solid #777;border-right:1px solid #777;'> Header </div>";