-
1. Re: Complex PDF generation and architecture question
norman.richards Nov 16, 2007 1:43 PM (in response to bolke)The itext support was designed to be the simplest possible thing that works while still being extremely easy to extend to support more itext concepts. I've been extending it according to user requests, but it's mostly been in maintenance mode for the last few releases. The next big change I will make is to try and remove the troubling redirect. The options are limited since facelets tragically doesn't support non-text output, but I think I can render the template in the background and return the PDF to the user immediately.
I'd love to improve the header/footer support as you suggest. Right now it's a real pain because what itext is doing here is really inconvenient. I you have any code, just open up a JIRA issue, and I'll work with you to get it in. -
2. Re: Complex PDF generation and architecture question
supernovasoftware.com Nov 16, 2007 1:48 PM (in response to bolke)I am using Jasper Reports for PDF generation. Are that any plans to integrate Jasper Reports or some other reporting engine into to Seam?
I do appreciate the quartz integration. :) -
3. Re: Complex PDF generation and architecture question
bolke Nov 16, 2007 5:51 PM (in response to bolke)Ah thanks for the response. Indeed what iText is doing here pretty inconvenient. This makes me wonder why the choice for iText, besides being quite popular? Speed?
Jasper or Apache FOP could be candidates as well.
my current approach is slightly hackish. Using a facet with a name 'header' allows to get to the PdfWriter / Document before it gets opened. I was thinking about something along the lines of having a pageEvents tag with event tags as childs. Eg:<facet name="header"> <p:pageEvents> <event name="onEndPage"> ... </event> </p:pageEvents> </facet>
At the moment I end up with a wrapper around PdfPageEvent (if I remember correctly) which allows to 'register' events by adding it to a hashmap. But to be honest, it does not feel really nice and I am juggling with classes. -
4. Re: Complex PDF generation and architecture question
damianharvey Nov 17, 2007 7:24 AM (in response to bolke)I've moved away from the tags for complex PDFs and started using existing PDFs as templates and then writing data into them (acrofields) and over them (using getOverContent) and then PdfStamping them as new PDFs. You end up with something that looks very good while not having to write that much code. You are also able to get a designer to create the PDF (eg. an invoice) in a way that would be rather difficult with iText.
Cheers,
Damian. -
5. Re: Complex PDF generation and architecture question
norman.richards Nov 17, 2007 3:04 PM (in response to bolke)That's more of the model I'd like to move towards. I feel iText (and all the pdf generators really) are only suited for medium quality output. If you want high quality output, I think using a template from a high-quality PDF tool is the best way to go.
-
6. Re: Complex PDF generation and architecture question
kukeltje Nov 18, 2007 4:50 PM (in response to bolke)If I find the time, I'll update my locally created tags to seam 2.0 and post them. I made tags that take an existing pdf and can do either:
- fill in forms based on acrofield names
- do overlay based on x,y coordinates in combination with a pagenumber
It works kinda great, but never found the time to update it and really test it. There is a jira issue for this afaik where I'll attach the code I have -
7. Re: Complex PDF generation and architecture question
bolke Nov 19, 2007 4:47 AM (in response to bolke)How flexible is PDF stamping? Is it possible for example to extend tables or leave parts out if they are not needed? Are there opensource tools that are able to generate these templates?
@kukeltje: if you could attach your not cleaned up stuff others might be able to fix that. -
8. Re: Complex PDF generation and architecture question
damianharvey Nov 19, 2007 7:26 AM (in response to bolke)If you don't have Adobe Acrobat you can create a PDF with whatever tool (eg Word [worstcase]) and then add the acrofields with iText itself to create a template.
You can do anything with the stamping/overlay. It's very flexible. I'm adding a table and also a rotated watermark.
@kukeltje: your tags sound cool. Would love to see them.
Cheers,
Damian