合并MySQL数据库中的PDF Blob文件 [英] Combine PDF Blob Files from MySQL Database

查看:106
本文介绍了合并MySQL数据库中的PDF Blob文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将大量PDF blob文件合并为一个PDF,以便随后进行打印?

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; 

?>

推荐答案

如何将大量PDF blob文件合并为一个PDF,以便随后进行打印?

How do I combine numerous PDF blob files into a single PDF so that can then be printed?

您不这样做-至少不是通过简单地组合字节流来实现的.您将需要处理每个文件,然后将它们合并到新的PDF文档中.

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:

如何通过程序在pdf内合并图像?/a>

How to combine images inside pdf by programme?

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆