Create PDFs from multipage forms in WebObjects - java

I would like to automatically generate PDF documents from WebObjects based on mulitpage forms. Assuming I have a class which can assemble the related forms (java/wod files) is there a good way to then parse the individual forms into a PDF instead of going to the screen?

The canonical response when asked about PDFs from WebObjects has generally been ReportMill. It's a PDF document generating framework that works a lot like WebObjects, and includes its own graphical PDF builder tool similar to WebObjects Builder and Interface Builder. You can bind elements in your generated PDFs to dynamic data in your application just as you would for a WOComponent.
They have couple of tutorial videos on the ReportMill product page that should give you an idea of how the tool works. It'll probably be a lot easier than trying to work with FOP programmatically.

I'm not familiar with WebObjects, but I see you have java listed in there.
iText is a java api for building pdfs. If you can access a java api from WebObjects you should be able to build pdfs that way.

ERPDFWrapper component in Project Wonder: Site link

ScArcher2>>
I have looked into different routes for creating PDFs on the fly including FOP and a few Java libraries. I think what I am really asking is if anyone has already done this in the WebObjects framework. My hope is that someone familiar with WebObjects might have done this already and have some insight that would save me some time.

You can use ReportMill or Jasper Reports. Compared with ReportMill Jasper Reports is Free but requires learning huge library. You can use IReport or Jasper Assistant eclipse plugin(If you are using WOLips) for building report templates. My experiance both are good.

Jasper Reports support have been added to Project Wonder a week ago :
Site Link Video
A talk about that new framework was done at WOWODC 2010, and it was recorded. Check wocommunity.org and the mailing list about that in October.

Related

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.

Design PDF template and populate data at runtime using java,xml etc

well i have been looking for a java based PDF solutions...we dont have a clean way i guess-still.. all solutions are primitive and kind of workarounds... No easy solution for this requirement -
1. Designing a PDF template using a IDE (eg. Livecycle designer ..which is not free)
2. Then at runtime using java, populate data into this PDF template...either using xml or other datasources...
such a simple requirement and NONE has a good "open-source and free" solution yet ! Is anyone aware of any ? I have been searching for since 3-4 years now..for a clean way out...
Eclipse BIRT comes close.. but does not handle Barcode elements ..OOB.
Jasper - ireport is also good but that tool does not have a table concept and is kind of annoying ! Also barcode support is not good.
XSL-FO has not free IDE for design .
Looking for a better answer .. got one ?
If it's a "simple requirement", you could create a report designer around iText and release it as FOSS yourself.
What are your key requirements? Does your input have to be a PDF? If so, you'll be probably working uphill for a long time still. Obviously you want to inject data and output a PDF.
If your templates can be something other than PDF, you could try using the OpenOffice API to get OpenOffice to do manipulate documents and produce a PDF. JODReports or Docmosis would be better ways of interacting with OpenOffice and Docmosis allows you to treat documents (doc and odt) as templates.
You can create a PDF file with AcroField through iText API AcroField values can be populated.
Note: Using OpenOffice you can create PDF document with FormFields.
http://blog.rubypdf.com/2007/08/01/freely-fill-pdf-form-with-the-help-of-itext-or-itextsharp/
You could use OpenOffice's UNO API. It looks rather heavyweight but at least you get something full-featured.
Have a look at XDocReport. You create your templates in word .docx or OpenOffice .odt files, then turn them into populated PDF files with Java code.

Creating PDF for Java applications

How to create pdf with complex design views in Java?I have tried it using jasper reports.Is there Any Ideas for creating PDF for Income tax forms?.
A commonly used Java API to create PDF files is iText. Give it a look. API documentation can be found here, code examples can be found here, a tutorial can be found here.
A good but less widely known Java API is OOo API wherein you can create any OOo document to your taste and finally export to PDF.
Have you taken a look at the Apache PDFBox project. I believe you can create PDFs using this library, although it is more commonly used in Lucene to convert PDFs to text to allow indexing.
You could also try Docmosis or JODConverter to do the conversion as long as you can install OpenOffice somewhere. They work on many platforms and can be Java controlled and will save you the hassle of learning the OOo UNO API.
Design your complex PDF Form with the appropriate tools, something like Acrobat Professional. Then from your Java code, you generate an FDF file (Form Data Format) and let the PDF Reader do the merging or you do it from the server-side and stream back the result.
Possible solutions to process FDF are Adobe Java FDF Toolkit or Apache PDFBox.
one approach that requires very little programming is converting your Java object to XML using the Java Binding API for XML (JABX) and then use apache FOP (XSL-FO) to create the PDF from XML. The adavantage of this approach is that is almost 100% declarative, .i.e no programming involved other than executing jabx and apache fop. If you want a tool to create the XSL-FO template, look at J4L FO Designer
You can try ITextPDF.jar Add this jar to your application and please go through the examples to know more about the tags and design procedure used for creating a PDF Document. Check this link for a simple exmaple http://itextpdf.com/examples/iia.php?id=12

Generating PDF files dynamically in servlets?

Is there any way to create PDF dynamically against receiving texts and images?
You can use the iText library.
If you're generating reports then JasperReports can generate PDF output.
iText and JasperReports are great to create pdf reports via Java.
With iReport you can easily create the jasper files needed for this. Very easy to use tool and helped me a lot when I needed to create some pdf reports.
We use Flying Saucer.
There are several libraries for working with PDF in Java, for example iText and Apache PDFBox.
There's a ton of ways to generate PDFs on the fly.
In Java, you can use the iText library. If you wanted to use Jython, you could use reStructuredText and possibly rst2pdf. Or you could just generate LaTeX files on the fly and make a system call to LaTeX.
A bit late but maybe useful to other searchers. Docmosis can populate templates and produce documents on the fly. Assuming you mean you need to include images and text, Docmosis can populate these on the fly from Java objects, text/image files, database queries etc. Java and Openoffice are required server-side.
I work with Apache FOP and it works amazingly well. It's well supported and it's based on the XSL-FO standard.
If you're doing reports based on for example SQL queries then iReport is a good choice although it's sometimes a bit heavyweight. On the other hand if you're going to produce something that's more about presentation and design, like a product sheet or a brochure then my experience is that it's alot easier to first generate html and css and then use it to generate a PDF.

Categories