<?php

include_once("modules/EcmProductB2Bs/productCardReallyNew.php");
include_once("include/html2fpdf/html2fpdf.php");
$p=new HTML2FPDF("L");
$p->SetAutoPageBreak(10);


$p=productCardNew($p,$_REQUEST['record'],$_GET['language'],true,true,"","",$_REQUEST['show_price'], $_REQUEST['ean'], $_REQUEST['simage']);

if($_REQUEST['create_img']==1){
	$guid=create_guid();
	$type="F";
	$file="cache/upload/Catalogue".$guid.".pdf";
}
else{
	$type="D";
	$file="Catalogue".date("YmdHi").".pdf";
}
$p->Output($file,$type);

if($_REQUEST['create_img']==1){
	exec("convert -density 120 -quality 100 /var/www/html/e5new/".$file." /var/www/html/e5new/".str_replace(".pdf",".jpg",$file));
	chmod(str_replace(".pdf",".jpg",$file),0777);
	header("Location: index.php?module=EcmProductB2Bs&action=showProductsCardImages&to_pdf=1&guid=".$guid);
}
?>