merge word files

merge word files

I need to merge word and pdf files. The most important is to merge doc* files. I´ve found pdf concatenate on forge and I will research if I can use it. However I didn´t find anything related to word. Someone can help me ?

There's the OfficeUtils component, but I'm sure it can do the kind of Word merging you're looking for. We have written our own extension using Aspose Words, but that has a paid license.
Hi Luciano,

We have built our own extension to perform operations on PDFs using Aspose PDF but we took help from OutSystems to write that code. Aspose PDF is a paid license.
Sorry guys but OfficeUtils doesn´t merge files and I am needing something free.
I understand you're thinking that, but sometimes there just isn't something free :).
Hi Luciano,

Have you tried to use Open XML SDK? I'm not entirely sure, but I think it is free. See if this link helps you.


André Siébra
Luciano, Have you considered using a cloud based solution and using the API to bring back the final doc? Of course, security of information within the docs is critical so be careful going this route. As Kilian mentioned...Aspose is a good tool.
Hi André,
   I researched this before post my question and I didn´t like this solution.
   only makes sense if I pay something to use a cloud solution. There is no sense expose the system to a weakness becaming it unstable if there is no support to the solution.

It seems my way to solve this is to create a C# program and use the Integration Studio to link with Service Studio. The problem is that I don´t know how to do this. Someone knows where I can get articles or documentation showing how to use the IS ?
There is a documentation in Integration Studio Help.

   usually OutSystems documentation are not easy to understand. I am talking about something practical. Even the  "watch integration studio tour" doesn´t open when I click on it after the lauch of IS.

If you are opting for Aspose, I can give you some pointers, as we've integrated with Aspose Words a few years ago.
Thank you Kilian
   I saw the Aspose site and there is a try our apis for free. Can you help me to do a proof of concept (POC) to see if it is wealth ?
   Do you know how much time I can use this try ?

Hi Luciano,

You should be able to create your own proof of concept by extending the existing forge component "Apose Words". It should be necessary to change a little bit using Integration Studio and also don't forget to attached your Aspose license (it will work also with the free version).

Paulo Garrudo
Yeah, I forgot about that one. Luciano, try the forge component first, and if it doesn't work out, PM me.
Thanks Paulo and Kilian
  the AsposeWords component has only DocToPdf, InsertImage and MailMergeDoc. There is not a method to merge doc files. I don´t know how to use Integration Studio and how can I solve this ? Any tip ?
Integration Studio can access the table inside the Service Studio ? 
The best solution I came across was to send the ids of the files I have in Service Studio DB. I ´ve found the function to append files on Aspose (Document.AppendDocument Method) and video about how to use the integration ( However, the doubt is: how to enable the DB access to IS to C# iterates over the registers ?

You should pass a record list of the desired data to the action in the extension.
I tried Kilian,
   but this error appeared. How to solve this and how to tell to C# how to access the DB ?
Hi Luciano,

Unfortunately, you didn't include the error, it seems. Again, you do not want to access the database from the extension. You need to fetch the data in the eSpace, and pass it on to the extension in a parameter.
Now it is attached. In the body of the text it is not appearing.
Actually my file is inside the database. I will overload the parameters if I send the files through them. I decided to save them in the DB to avoid maintanance problems in local directories.
The parameters in the picture will show the general idea I would like to use.
Hi Luciano,

If you need an Excel file from the database as input, then you should read it from the database first, then pass it on to the action in the Extension (as binary or object, depending on what you need to do).

As for the error, this is not truely an error, but just a reminder you need to set the type of the Record List, just like in Service Studio. Integration Studio is a bit primitive in that respect.
Now you arrived to my question. As I asked previously, how can I tell to IS to access my entity on Service Studio ? (Actualy inside my environment on If IS can access SS it can import the entity structure, am I right ?
Hi Luciano,

You have two options:
1) Create a predefined structure inside Integration Studio and consume that in Service Studio. This is the easiest option, because you can use those structures in Integration Studio directly.
2) Have parameters of Object type in your IS actions, and use reflection to pry out the data. This is much harder, but gives you greater flexibility.

What I've done for our mail merge implementation is pass the data as an Object, but have a data mapping structure defined in IS. That structure tells what attributes in the data map to what merge fields in the document. It's very flexible, but it's not the easiest readible code...
Hi Killian,
  I would like to do that and really is easier. However, my flow is in the opposite side. I have about 7 files, for example, into SS and I need to send them to IS. These files are not predeterminated and depend on customer options. So, keep the file available to IS is the best way to solve the problem. I use the ids and do all apends inside IS.
Do you know how I connect to outsystemscloud database to use these registers ?
Hi Luciano,

In the end, it's all code running in IIS. It doesn't matter whether it's generated by the Platform from Service Studio, or whether it is more directly written in C# in Integration Studio. However, IS is meant for extensions of the Platform, for cases you can't solve otherwise. So you should really limit what IS does to a bare minimum. Otherwise you'll be using the Platform as a container for C# plug-ins, which kinda defeats the purpose of the OutSystems Platform.

I'm not sure whether you can connect to the OS database from IS or not, but I'm pretty sure you can't do that easily (without resorting to determining physical table names and such), and I'm also pretty sure that's not what you should want!

Without more information, it's difficult for me to understand your use case, so I can't advise you on the best strategy. I can however say that if you think accessing the Platform database from IS is the solution, you have defined the wrong problem.
ok, you have your point. So the overload goes to the parameters through a list of documents. Do you know how to enable a structure that does not have a fixed length ?
Please, see the attached file. I did a draft of the new interface to implement the new solution.

Hi Luciano,

I'm having a training currently, but will get back to you when finished (probably this evening or tomorrow evening).
Hi Kilian,
   no problem.

Thank you for your feedback
Hi Luciano,

I'm not sure what you mean. Binary Data doesn't have a length. You can create an attribute of type Binary Data, and put the data in it.
Hi Kilian,
  I will do that. It seems IS was requesting it... 

IS is rather... "primitive" in many respects :).