Templated correspondence generation using Java - java

I am looking for a way to create pixel perfect, paginated, styled correspondence in a Java web application.
The requirements for this functionality are
- Ability to define outer/ master template with header/ footer/ logo etc...
- Ability to define inner content template where specific variables/ fields can be substituted with instance values at run time - e.g. employeeName. employeeAddress. The content template would be defined online using rich text editor or something similar
- Supports tables/ list
I believe iText does most/ if not all. Other options that I have considered is BIRT. Are there other/ better choices for this purpose?
Thanks

I have done something like with iText, although our case did not use an online text editor (we had a small number of templates and they were defined as part of the development cycle)
[Note: We did this under an older version of iText when it was still LGPL rather than Affero GPL]
The results were excellent, but in order to get it pixel-perfect we had to do a lot of work ourselves. We did manual layout and pagination - including manual text wrapping, etc. The layout tools that iText provides looked good, but they didn't give us the pixel-perfect control that we needed for the use case we had.

Have a look at iReport.

Related

How to generate a PDF output from a template PDF using something other than iText?

I'm working on a small Scala/Java prototype where I have several PDF templates i.e. they have text and image placeholders and the placeholders should be replaced with some content. Some sections are also multiple i.e. the actual number of occurrences or repetitions depends on the input. Then finally I need to generate and append an extra PDF page.
I'm aware that these use-cases can be covered using iText. My question is whether I can use an alternative solution for this (and how to do it). I'd prefer to avoid commercial solutions for the time being.
UPDATE: I'd like my PDF templates to be created by professional designers. They will know where the placeholders will be but should have full control on the design aspects. This requirement discards solutions based solely on XML inputs or others where the PDF is created fully programmatically.
Jasper - It's sofrware designed for crating dynamic reports connected with database inputs, but I think it can be utilized in the way you want. Has a graphical designer (either iReport or JaspersoftStudio based on your preferences), supports passing multiple variables with content or even images. Long static formatted texts may be a problem, but you will have to judge that for yourself.
JODReports + JODConverter - those two tools will allow your designers to work in pure ODT (OpenOffice format) files putting in dynamic data as variables that you will be able to substitute to your hearts desires from your Java code and print the output in PDF format. More than that, thanks to Java UNO API you can seize full control over the way your template looks and behaves if your inserted texts are really complex (though admittedly it's not intuitive to use).

Generate pdf empty signature fields free for commercial use

Is there any java lib that I can use (Itext is not free to use for commercial sites) to generate empty digital signature fields in java from servlets or jsp . I must have more than one empty signature field generated . Php has TCPDF , is there something similar in java .
As there was no answer but the JasperReports one yet (and it can be considered an overkill to use a full-blown reporting suite just to add an empty signature field to a document), I'm consolidating my comments as a second answer here:
You want to to generate empty digital signature fields in java but don't want to use iText because it is not free to use for commercial sites.
If you merely want to create empty signature fields and it is not important to be state-of-the-art concerning the many additions and bug fixes in newer versions of iText, you can consider using the latest iText version published under LGPL, i.e. 2.1.7 or (the unofficial) 4.2.0. There are some minor fixes in the latter one as compared to the former one, so you might want to prefer that version.
In that case I would propose you check out the SVN branch in question and build it yourself instead of using one of the versions built by some third parties because some of them include undocumented changes.
I am sure that you can somehow do that with PDFBox, too, because that library exposes the low level objects of PDFs it processes quite publicly. As I'm not really into that library, I cannot tell how to do that in detail. You can simply take some PDFBox samples creating form fields, consult the PDF specification ISO 32000-1:2008, and implement it, it should not be too difficult.
A newer player among the free PDF libraries is PDF Clown. According to its doc, it doesn't deal with signatures yet. It does work with form fields and general annotations, though, so it should not be difficult to add the functionality required by you, either --- empty signature fields actually are very simple form fields, the cryptographic fun does not start before actually signing a PDF, either using an empty signature field or creating a new one on the fly.
In this case you might have to change the lib itself while in case of PDFBox I assume you can simply use the lib. But you may be able to fascinate Stefano Chizzolini, the PDF Clown creatror, to integrate that change.
All this being said, I do agree with Bruno's comment that anyone making profit (commercial use) by using a library created by someone else (iText in the case at hand) should not restrain from somehow sharing, either by sharing his code (i.e. using iText according to the AGPL) or by paying for iText.
Of course, there sometimes are adverse constraints, e.g. a management very slow to allow sharing but very quick to demand realization from its dev staff... <sigh>
Try JasperReports. It has a nice GUI for designing your PDFs.

Is it possible to fill templates (.xls, .pdf, ppt) with Birt or alternatives?

is it possible to fill a predefined template file via birt reporting?
.xls for exmaple: The template should have defined the column headers (nicly formatted) and some other stuff like the date of creation, the user, some legal notice, ...
.pdf on the other hand should define id-fields that are to be filled with data
.ppt as the last and may be trickiest one should ideally be also be useable as .pdf but as far as I know .ppt itself does not provide IDs for its fields and therefore a workaround must be used to identify the places to be filled
Are there alternatives to birt that might be able to do that?
I'm very curious about the answers :-)
Thanks a lot!
Templater supports docx and xlsx. From there we are generating PDFs using LibreOffice.
Being author of the tool, I highly recommend it :)
There are plenty of examples on site if you are interested.
It could be very challenging to hit a predifined Excle format with the native BIRT Excel emitter, there are several after market Excel emitters that might help you get there.
The easier way is to set up your BIRT report to export with the format you want, then save report and use it as foundation for recreating the next report. You can use grids, and master pages to get just the layout you want, then plug in report pieces.
You can also use the library to save grids, tables & data sets that you use over and over.
The Spudsoft XLS Emitter for BIRT (which is builtin with BIRT 4.3.1) supports this for XLS.
We are using this feature and it works like a charm.
However, BIRT does not support "filling" doc or ppt docs.
Templating engines usually have difficulties to support master-detail (or master-detail-detail) relationships. This is due to the somewhat stupid implementation of tables in MS Word.

JasperReports as a generic document generation tool

I need some input if this is possible.
I guess most of you who have used JasperReports use it to - obviously - generate reports.
My question is, can you use it to generate generic documents? Ergo, documents that AREN'T reports. Say, for example, an automated letter of authority with fields you can just populate at run time. Or a company form that is filled up by your app then generates a pdf using JasperReports.
The only other solution that came up was iText, which I believe is far more capable of achieving the desired output.
Any inputs would be appreciated. Thanks.
You could, but I wouldn't--IMO you're better off using raw iText, or one of the dynamic languge PDF generators. IIRC iText can fill in PDF forms, too, so if you have someone else creating the PDFs, they can just be populated via iText.
OTOH, if they're relatively simple, it probably doesn't matter very much--you can pass non-tabular data to JR, I'm just not sure it's any easier that way.
I do all kinds of elaborate reports with iReport. It is an amazing designer for JasperReports. It allows to drag and drop components and connect to your DB or JavaBean Datasources with wizards. A very mature application that gives you all sorts of report exporting capabilities.
With iText you can do anything. But it is a programming API and so you either have to create your own design tool or construct the reports in code. For something simple or that will rarely change, it works well.
If you want a full-blown docgen solution, you need a product like Document Science, Thunderhead, or Windward Docgen (disclaimer, I'm the CTO at Windward). The beauty of these solutions is you design templates (in the case of Windward you design in Word) that are then passed to the system so it does not require programming to create/revise a document. And they output to pretty much any format.

GWT URL routing and other features

I am thinking about using GWT in my future project. I have few questions:
How can I define the structure of URLs? Does it allow me to recognize the parts of the URL by some information I have in database? How it is defined? Directly in Java or XML?
Does it support HTML5 history tools to change the URL without the necessity of using hashes?
Forms and editation of items in database - does it allow to generate Forms by definition and generate their validation, without the necessity of writing everything hard by hand?
Are there any tools for uploading files (images) in iframes, so that the page does not have to me reloaded? Drag'n'drop uploading? Are there any tools to simply manipulate uploaded images? Resize, crop...
Is it natively possible to create similar hover information like it can be seen on (for inst. when you hover an item on the left, there is an information bubble appearing on the right side):
http://goout.cz/theatre/prague/
Is it natively possible to create similar search dialog like on the page http://goout.cz - for inst. when you type 'a' it starts to suggest items in the database with their pictures.
All the GWT application I've found, run in browser rather as an JS application - but is it possible for javascript disabled browser to use them? Can search engines go through them?
Thanks
1. How can I define the structure of URLs? Does it allow me to recognize the parts of the URL by some information I have in database? How it is defined? Directly in Java or XML?
It's up to you to code it all (or almost all) by hand, in Java.
2. Does it support HTML5 history tools to change the URL without the necessity of using hashes?
It's possible to do it (quite easily actually) but GWT doesn't provide built-in support.
3. Forms and editation of items in database - does it allow to generate Forms by definition and generate their validation, without the necessity of writing everything hard by hand?
No. Editors cut the boilerplate by half, but you still have to build your forms by hand (but that's not a bad things: generated things never look or behave like you'd like to). And UiBinder helps creating UIs.
4. Are there any tools for uploading files (images) in iframes, so that the page does not have to me reloaded?
Yes.
Drag'n'drop uploading?
Not directly. There's support for native drag-and-drop, but not for accessing dropped files and uploading them. It's not hard to add though.
Are there any tools to simply manipulate uploaded images? Resize, crop...
The canvas API is supported but you'd have to do it all "by hand" (including, particularly, getting the image to draw it to the canvas, and then upload the canvas content)
5. Is it natively possible to create similar hover information like it can be seen on (for inst. when you hover an item on the left, there is an information bubble appearing on the right side): http://goout.cz/theatre/prague/
Yes.
6. Is it natively possible to create similar search dialog like on the page http://goout.cz - for inst. when you type 'a' it starts to suggest items in the database with their pictures.
Yes.
7. All the GWT application I've found, run in browser rather as an JS application - but is it possible for javascript disabled browser to use them?
No.
Can search engines go through them?
Google can, with little effort.

Categories