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.
Related
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).
I've been searching from hours how to generate from scratch an Open Office document (but a .doc would be glad, no docx) with a Java API (I'm using Grails). Anyway it seems that every method require a preexisting document to work correctly. I've looked on javaranch (http://www.coderanch.com/how-to/java/AccessingFileFormats) and nothing I've seen meets my desires.
So I ask you the question : is it actually possible to generate a .doc or .odt file from scratch ? Because I find that creating a document outside the code is pretty ugly.
Cheers
First, decide which "open office" you are talking about. Either it is "Office Open XML" which is the Microsoft branding of their XML document, or it is "OpenOffice" which is the native document format of "Libre Office/Open Office/Star Office" suites (and about 50 others).
Also, if you are searching for tutorials on how to access the internals of a document, odds are excellent that you will find instructions that require a document exist (to be accessed).
Perhaps searching for programmatic document creation would help, but if that doesn't land you what you need, you could note the libraries used to modify a document, and see if any of them provide APIs for "clean" document generation. Odds are good that one of them does, even if it is incomplete.
Sorry for the general answer, but it has to be general, as from the tag list, it is not even clear in which document format you intend to write.
OpenOffice.org's Universal Network Objects (UNO), allow you to generate .doc,.PDF, as well as OpenOffice documents. It supports several programming languages like: Java, C++, Visual Basic, etcc..
Some good things is that: its free, open source and plataform-independent
You can build documents, spreadsheets, presentations, etc. Start from scratch or using a template and fill the gaps..
In order to use it you will need to include some libraries that comes with the OpenOffice suite.
Useful links:
Open Office home
Open Office UNO Developer's Guide
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.
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.
I have a need to generate some PDF documents through Java .. Which API or library, etc, can I use to do this in the most effective way ?
EDIT: Added requirements:
I'll be using this for a commercial application, so I'd like to work with a library which is free to use for commercial applications as well ..
Secondly, my work will be like this: I have a pre-defined PDF file which has blank text fields in it. This would be my 'template file', and can be generated manually. Then, within my program, I would then take this file, put data into the text fields and generate new PDFs. And this would be done repeatedly.
So for the above added requirements, what would be the best library for me now ? iText does seem appealing, but it seems I would have to pay for it if I wanted to use it in a commercial app, which I'd like to avoid ..
http://itextpdf.com/download.php
Check out iText:
http://itextpdf.com/
I am using Apache PDFBox to generate PDF in java
Reference : https://pdfbox.apache.org/
iText is probably the best, but if you cannot live with their license there is also Apache PDFBox.
If you are creating your PDF templates yourself, then you might want to look at Docmosis - it lets you create templates in Word or OpenOffice with fields that you replace when you render documents. There is a free version you can distribute with your application if your document volumes are low.