i have some pdf's that are stored in a SQL server with data type Image. Now I want to merge them into a single document with Imagic from a PHP page. here is the code
$combined = new Imagick();
while( $document = mssql_fetch_assoc( $mssqlResult ){
$image = new Imagick();
$image->readImageBlob( $document['Contents'] ) ;
$combined->addImage( $image );
$image->clear();
$image->destroy();
}
$combined->setImageFormat("pdf");
$combined->writeImages( 'test.pdf', true );
Bu çalışacak ve test.pdf sever kaydedilir. ama çıkış için therough tarayıcı url, böyle olmaz işleri (http://www.test.com/test.php gibi bir şey) çalıştığınızda. kodudur
$combined = new Imagick();
while( $document = mssql_fetch_assoc( $mssqlResult ){
$image = new Imagick();
$image->readImageBlob( $document['Contents'] ) ;
$combined->addImage( $image );
$image->clear();
$image->destroy();
}
//$combined->getImageBlob();
//$combined->setImageFormat("pdf");
//$combined->writeImages( 'test.pdf', true );
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="test.pdf"');
echo $combined;
Herhangi bir yardım mutluluk duyacağız