Combine PDF Blob Files from MySQL Database
How do I combine numerous PDF blob files into 开发者_StackOverflowa single PDF so that can then be printed?
<?php
include 'config.php';
include 'connect.php';
$session= $_GET[session];
$query = "
SELECT $tbl_uploads.username, $tbl_uploads.description,
$tbl_uploads.type, $tbl_uploads.size, $tbl_uploads.content,
$tbl_members.session
FROM $tbl_uploads
LEFT JOIN $tbl_members
ON $tbl_uploads.username = $tbl_members.username
WHERE $tbl_members.session= '$session'";
$result = mysql_query($query) or die('Error, query failed');
while(list($username, $description, $type, $size, $content) =
mysql_fetch_array($result))
{
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: inline; filename=$username-$description.pdf");
}
echo $content;
mysql_close($link);
exit;
?>
How do I combine numerous PDF blob files into a single PDF so that can then be printed?
You don't - at least not by simply combining the byte streams. You will need to process each file, and merge them into a new PDF document.
Some pointers, maybe one of the solutions, depending on the platform you're on, works for you:
PHP - How to combine / merge multiple pdf’s
How to combine images inside pdf by programme?
Need to merge multiple pdf’s into a single PDF with Table Of Contents sections
pdftk will merge multiple PDF files, as well as PDFsam..
精彩评论