通过使用php脚本将多个doc或rtf文件合并为一个doc或rtf文件 [英] Merge multiple doc or rtf files into a single doc or rtf file by using php script

查看:115
本文介绍了通过使用php脚本将多个doc或rtf文件合并为一个doc或rtf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将多个doc或rtf文件合并到一个文件中,该文件应与多个文件的格式相同. 我的意思是,如果用户从列表框中选择多个rtf模板文件并单击网页上的按钮,则输出应该是一个包含多个rtf模板文件的rtf文件,为此我应该使用php.

我还没有决定模板文件的格式,但是它应该是rtf或doc,而且我还假定模板文件也包含一些图像.

我已经花了很多时间研究这个问题的图书馆,但仍然找不到它.

请在这里帮助我!! :(

谢谢.

解决方案

如果您正在寻找仅用于处理RTF文档的解决方案,则可以在此处找到合并多个RTF文档的PHP包:

www.rtftools.com

以下是有关如何将多个文档合并在一起的简短示例:

include ( 'path/to/RtfMerger.phpclass' ) ;

$merger = new RtfMerger ( 'sample1.rtf', 'sample2.rtf' ) ; // You can specify docs to be merged to the class constructor...
$merger -> Add ( 'sample3.rtf' ) ;                         // or by using the Add() method
$merger [] = 'sample4.rtf' ;                               // or by using the array access methods
$merger -> SaveTo ( 'output.rtf' ) ;                       // Will save files 'sample1' to 'sample4' into 'output.rtf'

此软件包允许您处理大于可用内存的文档.

I would like to merge multiple doc or rtf files into a single file which should be the same format of multiple files. What I mean is that if a user selects multiple rtf template files from a list box and clicks on a button on web page, the output should be a single rtf file which combines multiple rtf template files, I should use php for this.

I haven't decided the format of template files, but it should be either rtf or doc, and also I assume that template file has some images as well.

I have spent many hours to research the library for this, but still can't find it out.

Please help me out here!! :(

Thanks in advance.

解决方案

If you are searching for a solution for handling RTF documents only, you can find a PHP package to merge multiple RTF documents here :

www.rtftools.com

Here is a short example on how to merge multiple documents together :

include ( 'path/to/RtfMerger.phpclass' ) ;

$merger = new RtfMerger ( 'sample1.rtf', 'sample2.rtf' ) ; // You can specify docs to be merged to the class constructor...
$merger -> Add ( 'sample3.rtf' ) ;                         // or by using the Add() method
$merger [] = 'sample4.rtf' ;                               // or by using the array access methods
$merger -> SaveTo ( 'output.rtf' ) ;                       // Will save files 'sample1' to 'sample4' into 'output.rtf'

This package allows you to handle documents that are bigger than the available memory.

这篇关于通过使用php脚本将多个doc或rtf文件合并为一个doc或rtf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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