1

How do I combine numerous PDF blob files into a 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; 

?>
1

2 Answers 2

1

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:

Sign up to request clarification or add additional context in comments.

Comments

0

pdftk will merge multiple PDF files, as well as PDFsam..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.