export pdf without margin

Posted over 7 years ago by soulier

Post a topic

When I export a product.

This is exporting in good size but my photo is more little and appear a large margin.

An other problem, is that when I export this product, I've got in my pdf 2 pages one blank page an the other with my fotos. But there only one layer.

If you can help me it's very important and urgent.


Best regards.


Attachments (1)

1 Votes



Roddy Boyd posted over 7 years ago

Hi Jennifer, 

I had the same problem but was able to solve it by editing a couple lines of code in the plugin. 

in file /wp-content/plugins/fancy-product-designer/admin/class-admin-ajax.php around line 1050 there will be the text

// set document information
$pdf->SetCreator( get_site_url() );

// remove default header/footer


you need to change it to


// set document information
$pdf->SetCreator( get_site_url() );

// remove default header/footer

$pdf->SetMargins(0, 0, 0, true);
$pdf->setImageScale(1); //display image at original dimensions

$pdf->SetAutoPageBreak(false, 0);//we don't want any automatic new pages on oversets

 I also found that now the images didn't quite go the full width of the pdf. so you also have to change 

$pdf->Image('@'.$data_str,'', '', 0, 0, '', '', '', false, $dpi);



$pdf->Image('@'.$data_str, $x = '', $y = '',$w = $width, $h =0, $type ='', $link='', $align ='', $resize = false, $dpi);

 I ended up writing a class override to accomplish all of this. But it is tied in with a lot of other customisations i have on my website so i can't share it sorry. Just remember if you make the above changes if you update your plugin these will probably be overwritten

good luck


0 Votes

Login or Sign up to post a comment