Categories > OpenTBS with DOCX >

Can OpenTBS combine multiple docx files?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Mike OConnell
Date: 2011-06-23
Time: 02:06

Can OpenTBS combine multiple docx files?

I've successfully generated a .docx file using the OpenTBS plugin and a Word template, but when I try using the OPENTBS_ADDFILE, the Word file that downloads is corrupt. Is there something wrong with the code I'm using or maybe I'm misunderstanding what the add file function is for? Here's the line of code:

$TBS->Plugin(OPENTBS_ADDFILE, "secondpage.docx", "secondpage.docx", $DataType=TBSZIP_FILE, $Compress=false);

I've tried $Name, $Data, and $Compress several different ways but nothing seems to work.

Thanks!
By: Skrol29
Date: 2011-06-23
Time: 04:01

Re: Can OpenTBS combine multiple docx files?

Hi Mike,

OPENTBS_ADDFILE is not to insert a DocX in DocX .
OPENTBS_ADDFILE can only insert an XML file that may be useful for your DocX . This is a very technical feature to be used by advanced OpenXML coders.

OpenTBS cannot combine two DocX for now. This is a complicated operation because it implies to retrieve all styles, charts, images, objects from the Docx to insert ; and to place them correctly inside the target DocX.