<?php
App::import('Vendor','pdfdoc');

$pdfdoc = new PDFDOC();

$pdfdoc->SetPrintHeader(false);
$pdfdoc->SetPrintFooter(false);

$pdfdoc->SetPrintHeader(true);

$pdfdoc->AddPage();
$pdfdoc->Page1Header();


$first_page = $this->element('pdf_po_first_page');
$pdfdoc->pageContent($first_page);

$pdfdoc->SetTextColor(0);
$pageNo = $pdfdoc->PageNoFormatted();
$totalCount = $pdfdoc->getAliasNbPages();

$pdfdoc->AddPage();
$LineItemTable = $this->element('line_items_table_po'); //Because fuck it.

$pdfdoc->pageContent($LineItemTable);

$this->element('pdf_output', array('pdfdoc'=>$pdfdoc));

?>

<script type="text/javascript">
    window.location.replace("/documents/view/<?=$document['Document']['id']?>");
</script>

