FPDF images not working in MODx Revo -


i'm using modx revolution 2.2.1-pl , fpdf generate pdfs. i've found using images on 100kb (at least around ballpark) results in them being corrupted in outputted pdf. it's if image still half way through downloading when written pdf.

this snippet output onto page blank template:

require_once($modx->config['base_path']."assets/fpdf/fpdf.php");  define('fpdf_fontpath',$modx->config['base_path']."assets/fpdf/font/");  $pdf=new fpdf(); $pdf->addpage(); $pdf->addfont('novecentowidedemibold','','novecentowidedemibold.php'); $pdf->setfont('novecentowidedemibold','',16); $pdf->cell(40,10,'text'); $pdf->image('assets/img/pdf/image.jpg',0,0,-300); $pdf->output("myfile.pdf", d); 

it finds fonts , ok, it's image isn't working correctly. if use smaller image (filesize), works. it's finding image, , image fine, it's when printed pdf half there lots of glitches if never finished loading.

if take code , execute on same server not within modx outputted pdf works regardless of image file size.

is there can make sure image downloaded before pdf generated?

i had similar issue simplest of gifs, went content types , marked application/pdf had created binary solved , see images.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -