Thanks for the response. Attached is our code in the print.php file. It looks very similar to what you've suggested. Is there some difference we can make that would prevent our problem?
$file= 'http://'.$_SERVER['SERVER_NAME'].$_GET['file'];
$product_name = !empty ($_GET['product_name']) ? $_GET['product_name'] : 'product.pdf';
if ($file != '')
{
global $g_config;
$g_config = array(
'cssmedia' => 'print',
'renderimages' => true,
'renderforms' => false,
'renderlinks' => true,
'mode' => 'html',
'debugbox' => false,
'draw_page_border' => false
);
$media = Media::predefined('A4');
$media->set_landscape(false);
$media->set_margins(array('left' => 0,
'right' => 0,
'top' => 5,
'bottom' => 0));
$media->set_pixels(800);
global $g_px_scale;
$g_px_scale = mm2pt($media->width() - $media->margins['left'] - $media->margins['right']) / $media->pixels;
global $g_pt_scale;
$g_pt_scale = $g_px_scale * 1.43;
$pipeline = PipelineFactory::create_default_pipeline("","");
$pipeline->configure($g_config);
$pipeline->destination = new DestinationDownload($product_name);
$pipeline->process($file, $media);
}
else
{
echo "File not found";
}