1

I need merge several RTF documents by PHP. Styles, fonts, page sizes of all documents must be saved.

Is there some free tools or libs for this? Maybe somebody collide with this problem?

Or maybe somebody solve a problem by other programming language.

Charles
  • 50,943
  • 13
  • 104
  • 142
  • 1
    Possible duplicate of [Concatenate RTF files in PHP (REGEX)](http://stackoverflow.com/questions/153801/concatenate-rtf-files-in-php-regex) or [Merge multiple doc or rtf files into a single doc or rtf file by using php script](http://stackoverflow.com/questions/4030335/merge-multiple-doc-or-rtf-files-into-a-single-doc-or-rtf-file-by-using-php-scrip) – Charles Feb 16 '12 at 09:02

2 Answers2

1

You can find a PHP package to merge multiple RTF documents here :

www.rtftools.net

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.

1

This question and it's second answer might work for you. If it doesn't, perhaps take a look at this question. Or this question. One of them surely works.

Community
  • 1
  • 1
axiomer
  • 2,088
  • 1
  • 17
  • 26