I tried most of the suggestions at the below links (1.53 image scale and larger images)
I am printing a 5x7 greeting card with a front, back, and inside image. The image source files are pngs/jpegs (tried both).
If you look at images below and PDF result; the PDF looks washed out.
CODE: (1.53 image scale in global config)
public function build_design(Design $design)
{
PDF::SetTitle('Design');
PDF::setJPEGQuality(100);
PDF::AddPage();
//Needed for images not being right size https://stackoverflow.com/questions/8135975/why-is-tcpdf-image-smaller-than-it-should-be
PDF::SetAutoPageBreak(false, 0);
if ($design->get_image_by_name('Back'))
{
PDF::Image($design->get_image_by_name('Back')->image,0,0,5,7);
}
if ($design->get_image_by_name('Front'))
{
PDF::Image($design->get_image_by_name('Front')->image,5,0,5,7);
}
if ($design->get_image_by_name('Inside'))
{
PDF::AddPage();
PDF::Image($design->get_image_by_name('Inside')->image,0,0,10,7);
}
}
public function print_design(Design $design)
{
$this->build_design($design);
PDF::Output('design.pdf');
}
RESULTING PDF:
https://www.dropbox.com/s/w10vq8q48m0ljtt/card.pdf?dl=0
FRONT: 1500x2100 300 dpi PNG
INSIDE 3000x2100 300 dpi PNG
BACK: 1500x2100 300 dpi JPEG