Outsystems to PDF

Outsystems to PDF


I need to export the result of a query to a table with some "embellishment" of the final document (company logo, some "Total" fields from the table, a title and the date of generation of the file), to a PDF that will be stored in the filesystem.

What's the best way to achieve what I need?

I think that there are ways to do this with Crystal Reports or Reporting Services?
Or there would be another (and better) way to do this?

What do you all advise?

Thank you and Merry Christmas!
Hi Ana,

Attached is a simple solution to generate one url to pdf (it is a free one). In this case you could design your screen and the print it to pdf.

can you try this solution? It isn't available in the components yet but it will be after more tests ons this component since it one of the most requested.


EDIT: I'm having a problem to attach the osp file, please send me your email (in private message) so i can send it to you.
Hi Ricardo,

I'm also interested in the OSP.
And I think many more people want to use it.

Is it using an external site which does the conversion or are you creating it using an extension ?


Hi all

First, referece to the original code component http://code.google.com/p/wkhtmltopdf/ and credits to Vitor Rosário.

Second, to try this you should create an espace to encapsulate the extension, and the espace must have the "run as" user defined in service center.


Another alternative is to wrap a good PDF library as an extension. I like the Syncfusion controls, they are well priced and do a good job in my opinion. I use them for parsing PDFs, and I will (probably) eventually use them to generate PDFs too.

We've also used Aspose successfully. Our customer designs Word templates (dots) themselves which are merged with Aspose Words with live data (we detect which merge fields he added in the document and fetch them from the database), and in the end we transform the doc(x) into pdf with the PDF API.

We went for it considering
  • it is extremelly fast (we need to generate thousands of documents, each word merge + conversion to pdf was taking around 1.2 seconds the last time we measured) - We evaluated other faster components, but they were limited in support for the kind of manipulation we required over word and pdf
  • It is feature rich (the word automation API basically allows you to everything you might ever need; I don't know the pdf automation api so well)
  • the licensing scales very well 
To be honest, I think OutSystems needs to provide this functionality free of charge in their platform.
If I use PHP as platform, I can create PDF's without any problem/license (http://www.fpdf.org/ , http://www.tcpdf.org/index.php )
Joop, the solution attached before is free of charge.

As you might know, there is a huge product backlog, and every workitem is prioritize, so lets wait for it ...


There is also a similar library just like that for c# and java: iText (http://itextpdf.com/download.phphttp://itextpdf.com/itext.php)
It allows similar constructs. You just need to wrap it in an extension and you get the same feature set. I know it was already used in one of our projects.

My usual problem with these libraries is that they are very low level APIs, so you end up having a lot of work composing a PDF. Higher level APIs like Aspose provide you with more features out-of-the-box... that comes with a price.

There's also Epopeia Agile Reporting Services, which also allow exporting to PDF. If you compare such a solution with using APIs for building PDFs... there are huge productivity gains.
Joop -

If you can do it in PHP free of charge, it would make a lot of sense to (for the time being), make a PHP-based Web service that does what you need, and call it from Agile Platform. Not an ideal solution, but there is a certain point where I think it's unfair to expect OSAP to do something... simply because I shudder to think what the UI would look like if it actually got every feature in Wisdom of the Crowds. :)

Hello all!

I've analysed all your options, and ended up using Ricardo's solution HtmlToPDF.
It works like its supposed, and it's free.

Thank you Ricardo!

Best Regards,
Ana Sofia Santana

Hello everyone,

I'm having trouble using html2pdf solution above.

I was able to generate my page from the wkhtmltopdf command line on the server. However, when my application generates the same screen the PDF gets corrupted. It really does something since the file is not empty (about 12Kb). But then, when I try to open it I get Adobe Acrobat's error message: There was an error opening this document. The file is damaged and could not be repaired.

Any ideas?

Very appreciated!

Finally got it: screen authentication seems to cause this problem.

Also, be aware that wkhtmltopdf has an open issue on lack of flash support (http://code.google.com/p/wkhtmltopdf/issues/detail?id=48)

Hi there,

Has anyone successfully managed to insert page breaks or page numbers using the HTML to PDF extension?

I've tried css for page breaks, and it works ok while printing (using primopdf for example), but this wkhtmltopdf/ doesn't seem to recognize the Css...

As for the page numbers, if anyone has any suggestion, it will be welcome.

With Best Regards,

Diogo Cordovil S. Cordeiro
Anyone tried to print fusion charts with this? I have converted fusion charts to javascript mode but even that i cant get no chart in pdf
Filipe -

That's because Fusion Charts use Flash, and the took to do te PDF conversion isn't going to run Flash content.

No i am using javascript mode,not flash
Hi filipe, Could you tell me how you did the conversion from flash to javascript ...??? Best regards, Eric
Eric Oschatz wrote:
Hi filipe, Could you tell me how you did the conversion from flash to javascript ...??? Best regards, Eric
Hello Eric,

I don't think that Filipe has converted flash to javascript (I don't even know if that is possible).
I think that he wanted to say that he used the Fusion Charts but the version implemented in javaScript/Html5.

To read about this you can see the following page: http://www.shamasis.net/2010/03/jquery-plugin-for-fusioncharts-1-0-0b/

The official page for this components is:  http://www.fusioncharts.com/products/suite/?role=Developer

Best Regards,
Gonçalo Martins