You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Kevin Meyer - KMZ <ke...@kmz.co.za> on 2011/09/13 19:25:06 UTC
Domain-library class request: PDF output
Dear all,
Please could I ask for some assistance in creating Isis domain classes
to support creation of PDF files?
Does anyone have any experience with using java to create PDF files?
I am guessing that some sort of template would be required (to specify
what goes where), and a way of telling the PDF domain classes which
properties should be used.
Since Isis does not support documents as a value type yet (see ISIS-
115 [1]), I will probably use the email domain classes to send the result
to a recipient, assuming that I can add attachment support (if it isn't
already there).
Regards,
Kevin
[1] https://issues.apache.org/jira/browse/ISIS-115
Re: Domain-library class request: PDF output
Posted by Mike Burton <mi...@mycosystems.co.uk>.
Hi Kevin,
I've used JasperReports, which calls iText. I had some ideas for how this could be used in Isis, aside from licensing issues, along these lines...
A Report is itself an Object, encapsulating the details of what we want to "print", such as filters, fields (and maybe expressions defining composite/ derived fields) all taken from a Domain Object. Also agregate fields (total, average, max..) and grouping "bands" in which these agregates would appear.
Isis could create a "default report", maybe as a context menu operation from within Viewer. User could then add or remove properties on the Report and save it under a different name such as CustXyzReport. It would be nice to handle "joins" over >1 domain objects, and maybe styling.
Best Regards
Mike Burton
( from iPhone)
On 20 Sep 2011, at 17:52, Siegfried Goeschl <sg...@gmx.at> wrote:
> Hi Kevin,
>
> unfortunately I have a lot of experience but you would need to explain how the PDF generation should work in your opinion regarding content and layouting
>
> +) the iText approach is more or less building a PDF by code
>
> +) Apache PDFBox allows filling out PDF forms and creation of simple PDFs based on text data
>
> +) Apache FOP is a way to go but FOP templates and XSLT is, well, difficult
>
> +) my latest approach is converting HTML to PDF using "wkhtmltopdf" (http://code.google.com/p/wkhtmltopdf/)
>
> The main question is the layout - is it static or user-defined?
>
> Cheers,
>
> Siegfried Goeschl
>
>
>
> On 14.09.11 16:23, Kevin Meyer - KMZ wrote:
>> Dear Rob and Jeff,
>>
>> Having a quick look at iText, its licensing is definitely not ASF
>> compatible, so I could not add the results to the Isis domain.
>>
>> One of the comments [1] in Rob's referenced TSS article suggests
>> using Apache FOP [2]. I'll look into this first (perhaps I'll even be able
>> to create the XSLT stylesheet in OpenOffice - that'll be a real winner!
>>
>> Regards,
>> Kevin
>>
>> [1] http://www.theserverside.com/news/thread.tss?track=NL-
>> 461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2
>> 785788#349513
>>
>> [2] http://xmlgraphics.apache.org/fop/
>>
>> On 14 Sep 2011 at 9:49, Robert Matthews wrote:
>>
>>> Kevin
>>>
>>> I had a look at iText (http://itextpdf.com/) in the past, but have not
>>> used it. It struck me that it would be possible to use Isis to to
>>> actually design the document, not just render it. Also, there is
>>> posting on TSS (
>>> http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788
>>> <http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788>)
>>> titled "From java.awt.print.Printable to PDF" that sounds interesting
>>> (although I haven't read it yet).
>>>
>>> Regards
>>> Rob
>>>
>>> On 13/09/11 18:25, Kevin Meyer - KMZ wrote:
>>>> Dear all,
>>>>
>>>> Please could I ask for some assistance in creating Isis domain classes
>>>> to support creation of PDF files?
>>>>
>>>> Does anyone have any experience with using java to create PDF files?
>>>>
>>>> I am guessing that some sort of template would be required (to specify
>>>> what goes where), and a way of telling the PDF domain classes which
>>>> properties should be used.
>>>>
>>>> Since Isis does not support documents as a value type yet (see ISIS-
>>>> 115 [1]), I will probably use the email domain classes to send the result
>>>> to a recipient, assuming that I can add attachment support (if it isn't
>>>> already there).
>>>>
>>>> Regards,
>>>> Kevin
>>>>
>>>> [1] https://issues.apache.org/jira/browse/ISIS-115
>>
>>
Re: Domain-library class request: PDF output
Posted by Kevin Meyer <ke...@kmz.co.za>.
Hi Siegfried,
Thanks for your reply. I'm currently away, email via mobile, but a quick
reply is:
Ideally, I'd like a way of being able to create a layout with static
content using a GUI, e.g. word processor.
Dynamic content to be provided via domain (java).
Key would be ease with which users (non programmers) can add/edit such
templates.
e.g. for invoices, membership certificates, receipts, etc, for a
club/society.
As you say, fop & xslt is difficult, even in OpenOffice.
What is practically close to above?
Thanks,
Kevin
On Tue, September 20, 2011 23:52, Siegfried Goeschl wrote:
> Hi Kevin,
>
> unfortunately I have a lot of experience but you would need to explain
> how the PDF generation should work in your opinion regarding content and
> layouting
>
> +) the iText approach is more or less building a PDF by code
>
> +) Apache PDFBox allows filling out PDF forms and creation of simple
> PDFs based on text data
>
> +) Apache FOP is a way to go but FOP templates and XSLT is, well,
> difficult
>
> +) my latest approach is converting HTML to PDF using "wkhtmltopdf"
> (http://code.google.com/p/wkhtmltopdf/)
>
> The main question is the layout - is it static or user-defined?
>
> Cheers,
>
> Siegfried Goeschl
>
>
>
> On 14.09.11 16:23, Kevin Meyer - KMZ wrote:
>> Dear Rob and Jeff,
>>
>> Having a quick look at iText, its licensing is definitely not ASF
>> compatible, so I could not add the results to the Isis domain.
>>
>> One of the comments [1] in Rob's referenced TSS article suggests
>> using Apache FOP [2]. I'll look into this first (perhaps I'll even be
>> able
>> to create the XSLT stylesheet in OpenOffice - that'll be a real winner!
>>
>> Regards,
>> Kevin
>>
>> [1] http://www.theserverside.com/news/thread.tss?track=NL-
>> 461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2
>> 785788#349513
>>
>> [2] http://xmlgraphics.apache.org/fop/
>>
>> On 14 Sep 2011 at 9:49, Robert Matthews wrote:
>>
>>> Kevin
>>>
>>> I had a look at iText (http://itextpdf.com/) in the past, but have not
>>> used it. It struck me that it would be possible to use Isis to to
>>> actually design the document, not just render it. Also, there is
>>> posting on TSS (
>>> http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788
>>> <http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788>)
>>> titled "From java.awt.print.Printable to PDF" that sounds interesting
>>> (although I haven't read it yet).
>>>
>>> Regards
>>> Rob
>>>
>>> On 13/09/11 18:25, Kevin Meyer - KMZ wrote:
>>>> Dear all,
>>>>
>>>> Please could I ask for some assistance in creating Isis domain classes
>>>> to support creation of PDF files?
>>>>
>>>> Does anyone have any experience with using java to create PDF files?
>>>>
>>>> I am guessing that some sort of template would be required (to specify
>>>> what goes where), and a way of telling the PDF domain classes which
>>>> properties should be used.
>>>>
>>>> Since Isis does not support documents as a value type yet (see ISIS-
>>>> 115 [1]), I will probably use the email domain classes to send the
>>>> result
>>>> to a recipient, assuming that I can add attachment support (if it
>>>> isn't
>>>> already there).
>>>>
>>>> Regards,
>>>> Kevin
>>>>
>>>> [1] https://issues.apache.
Re: Domain-library class request: PDF output
Posted by Siegfried Goeschl <sg...@gmx.at>.
Hi Kevin,
unfortunately I have a lot of experience but you would need to explain
how the PDF generation should work in your opinion regarding content and
layouting
+) the iText approach is more or less building a PDF by code
+) Apache PDFBox allows filling out PDF forms and creation of simple
PDFs based on text data
+) Apache FOP is a way to go but FOP templates and XSLT is, well, difficult
+) my latest approach is converting HTML to PDF using "wkhtmltopdf"
(http://code.google.com/p/wkhtmltopdf/)
The main question is the layout - is it static or user-defined?
Cheers,
Siegfried Goeschl
On 14.09.11 16:23, Kevin Meyer - KMZ wrote:
> Dear Rob and Jeff,
>
> Having a quick look at iText, its licensing is definitely not ASF
> compatible, so I could not add the results to the Isis domain.
>
> One of the comments [1] in Rob's referenced TSS article suggests
> using Apache FOP [2]. I'll look into this first (perhaps I'll even be able
> to create the XSLT stylesheet in OpenOffice - that'll be a real winner!
>
> Regards,
> Kevin
>
> [1] http://www.theserverside.com/news/thread.tss?track=NL-
> 461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2
> 785788#349513
>
> [2] http://xmlgraphics.apache.org/fop/
>
> On 14 Sep 2011 at 9:49, Robert Matthews wrote:
>
>> Kevin
>>
>> I had a look at iText (http://itextpdf.com/) in the past, but have not
>> used it. It struck me that it would be possible to use Isis to to
>> actually design the document, not just render it. Also, there is
>> posting on TSS (
>> http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788
>> <http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788>)
>> titled "From java.awt.print.Printable to PDF" that sounds interesting
>> (although I haven't read it yet).
>>
>> Regards
>> Rob
>>
>> On 13/09/11 18:25, Kevin Meyer - KMZ wrote:
>>> Dear all,
>>>
>>> Please could I ask for some assistance in creating Isis domain classes
>>> to support creation of PDF files?
>>>
>>> Does anyone have any experience with using java to create PDF files?
>>>
>>> I am guessing that some sort of template would be required (to specify
>>> what goes where), and a way of telling the PDF domain classes which
>>> properties should be used.
>>>
>>> Since Isis does not support documents as a value type yet (see ISIS-
>>> 115 [1]), I will probably use the email domain classes to send the result
>>> to a recipient, assuming that I can add attachment support (if it isn't
>>> already there).
>>>
>>> Regards,
>>> Kevin
>>>
>>> [1] https://issues.apache.org/jira/browse/ISIS-115
>
>
Re: Domain-library class request: PDF output
Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Dear Rob and Jeff,
Having a quick look at iText, its licensing is definitely not ASF
compatible, so I could not add the results to the Isis domain.
One of the comments [1] in Rob's referenced TSS article suggests
using Apache FOP [2]. I'll look into this first (perhaps I'll even be able
to create the XSLT stylesheet in OpenOffice - that'll be a real winner!
Regards,
Kevin
[1] http://www.theserverside.com/news/thread.tss?track=NL-
461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2
785788#349513
[2] http://xmlgraphics.apache.org/fop/
On 14 Sep 2011 at 9:49, Robert Matthews wrote:
> Kevin
>
> I had a look at iText (http://itextpdf.com/) in the past, but have not
> used it. It struck me that it would be possible to use Isis to to
> actually design the document, not just render it. Also, there is
> posting on TSS (
> http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788
> <http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788>)
> titled "From java.awt.print.Printable to PDF" that sounds interesting
> (although I haven't read it yet).
>
> Regards
> Rob
>
> On 13/09/11 18:25, Kevin Meyer - KMZ wrote:
> > Dear all,
> >
> > Please could I ask for some assistance in creating Isis domain classes
> > to support creation of PDF files?
> >
> > Does anyone have any experience with using java to create PDF files?
> >
> > I am guessing that some sort of template would be required (to specify
> > what goes where), and a way of telling the PDF domain classes which
> > properties should be used.
> >
> > Since Isis does not support documents as a value type yet (see ISIS-
> > 115 [1]), I will probably use the email domain classes to send the result
> > to a recipient, assuming that I can add attachment support (if it isn't
> > already there).
> >
> > Regards,
> > Kevin
> >
> > [1] https://issues.apache.org/jira/browse/ISIS-115
Re: Domain-library class request: PDF output
Posted by Robert Matthews <rm...@nakedobjects.org>.
Kevin
I had a look at iText (http://itextpdf.com/) in the past, but have not
used it. It struck me that it would be possible to use Isis to to
actually design the document, not just render it. Also, there is
posting on TSS (
http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788
<http://www.theserverside.com/news/thread.tss?track=NL-461&ad=847070&thread_id=62927&asrc=EM_NLN_14864357&uid=2785788>)
titled "From java.awt.print.Printable to PDF" that sounds interesting
(although I haven't read it yet).
Regards
Rob
On 13/09/11 18:25, Kevin Meyer - KMZ wrote:
> Dear all,
>
> Please could I ask for some assistance in creating Isis domain classes
> to support creation of PDF files?
>
> Does anyone have any experience with using java to create PDF files?
>
> I am guessing that some sort of template would be required (to specify
> what goes where), and a way of telling the PDF domain classes which
> properties should be used.
>
> Since Isis does not support documents as a value type yet (see ISIS-
> 115 [1]), I will probably use the email domain classes to send the result
> to a recipient, assuming that I can add attachment support (if it isn't
> already there).
>
> Regards,
> Kevin
>
> [1] https://issues.apache.org/jira/browse/ISIS-115