Hello,
I've worked out from the tutorial how to create my own forms. Now I want to render the data from the forms in a PDF, exactly the way the Government Forms example does it. I can't quite figure out how it works, though. I see the pdf-detail-view.xpl, and the pdf-template.xml. What I'm not sure of is how they are used, I find it difficult to figure out where the magic happens. Can someone point me to some documentation, or actually what would be fantastic is if there was a "hello world" example of this. A 1-field form, and a view button that populates a 1-field pdf tempate. Any pointers would be much appreciated. Thanks, Jeff |
Administrator
|
Jeff,
Unfortunately there is no doc on this at the moment. I thought we had a bug about this but couldn't find it. Here is a new one: http://forge.objectweb.org/tracker/index.php?func=detail&aid=306992&group_id=168&atid=350207 In the Government form, things are glued together in the page flow with this entry: <page id="pdf-detail" path-info="/forms/pdf-detail/([^/]+)/([^/]+)" matcher="oxf:perl5-matcher" default-submission="detail/parameters.xml" view="detail/pdf-detail-view.xpl"> <setvalue ref="/parameters/form-id" matcher-group="1"/> <setvalue ref="/parameters/document-id" matcher-group="2"/> </page> -Erik weissjeffm wrote: > Hello, > > I've worked out from the tutorial how to create my own forms. Now I want to > render the data from the forms in a PDF, exactly the way the Government > Forms example does it. > > I can't quite figure out how it works, though. I see the > pdf-detail-view.xpl, and the pdf-template.xml. What I'm not sure of is how > they are used, I find it difficult to figure out where the magic happens. > > Can someone point me to some documentation, or actually what would be > fantastic is if there was a "hello world" example of this. A 1-field form, > and a view button that populates a 1-field pdf tempate. > > Any pointers would be much appreciated. > Thanks, > Jeff > > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Ok, in the meantime, maybe you could answer a few questions?
Here's what I've managed so far. I created a very simple 2-field PDF in Adobe Designer, and I have copied the pipeline from the gov't forms example, and tried to simplify it to do the most basic test. I made a simplified template.xml like so: <config xmlns:st="scoretest"> <template href="oxf:/apps/score-script/testform.pdf" show-grid="false" /> <field left="108.5" top="138" size="20" value="st:name" /> <field left="108.5" top="171" size="10" value="st:author" /> </config> The coordinates I just stole from the govt forms example, I had no idea what to use. When I click my "show pdf" button, the PDF loads, but the fields are empty, of course. There's no way it can work unless i make some kind of mapping between empty fields in the PDF file and values in my instance. I couldn't see anywhere this was done in the govt forms example. Is that what those coordinates are for? If so, where do they come from? I couldn't find anything like that in adobe designer, I assumed I'd use the Adobe's field names. Not so? Does the pdf-template code just overlay stuff right on the pdf without regard to the underlying structure? Thanks for any help you can offer me here. Oh yeah, would you happen to know what classes I can enable debug for, that might shed more light on what's happening? Thanks again. -Jeff
|
Sorry to self-reply.
I've made some progress, I have managed to get the right text to show up in my PDF! Unfortunately I am coming to the realization the way pdf-template works isn't what I want. It looks like pdf-template uses the iText library. But what it seems to do is spew text at arbirtrary locations all over the page, ignoring the PDF structure underneath. This breaks the MVC concept, doesn't it? iText *does* support filling in textfields, but I don't think that functionality is exposed in pdf-template. See this example of how to use iText to do this: http://itextdocs.lowagie.com/tutorial/ (see Manipulating Existing PDF Documents, "Register"). Here's a link to the java file: http://itext.ugent.be/library/com/lowagie/examples/general/copystamp/Register.java I'd be so interested in having this functionality, that I'd be willing to write it and contribute it. Unless it's already been done and I just don't have it (or see it) yet. Jeff Weiss
|
So are you saying that the processor ignores values in the left and top attributes? Can you send an example? <field left="108.5" top="138" size="20" value="st:name" /> A. On May 9, 2007, at 8:02 PM, weissjeffm wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by weissjeffm
Hi Jeff,
I, for one, would be interested in using this functionality if you were to implement it. Let me know how you go and if you want someone to help test what you do. Regards, Greg J. -----Original Message----- From: weissjeffm [mailto:[hidden email]] Sent: Thursday, 10 May 2007 4:02 AM To: [hidden email] Subject: Re: [ops-users] PDF template docs or simple example? Sorry to self-reply. I've made some progress, I have managed to get the right text to show up in my PDF! Unfortunately I am coming to the realization the way pdf-template works isn't what I want. It looks like pdf-template uses the iText library. But what it seems to do is spew text at arbirtrary locations all over the page, ignoring the PDF structure underneath. This breaks the MVC concept, doesn't it? iText *does* support filling in textfields, but I don't think that functionality is exposed in pdf-template. See this example of how to use iText to do this: http://itextdocs.lowagie.com/tutorial/ (see Manipulating Existing PDF Documents, "Register"). Here's a link to the java file: http://itext.ugent.be/library/com/lowagie/examples/general/copystamp/Registe r.java I'd be so interested in having this functionality, that I'd be willing to write it and contribute it. Unless it's already been done and I just don't have it (or see it) yet. Jeff Weiss weissjeffm wrote: > > Ok, in the meantime, maybe you could answer a few questions? > > Here's what I've managed so far. > > I created a very simple 2-field PDF in Adobe Designer, and I have > copied the pipeline from the gov't forms example, and tried to simplify it to do > the most basic test. I made a simplified template.xml like so: > > > <config xmlns:st="scoretest"> > <template href="oxf:/apps/score-script/testform.pdf" > show-grid="false" /> > <field left="108.5" top="138" size="20" value="st:name" /> > <field left="108.5" top="171" size="10" value="st:author" /> > </config> > > The coordinates I just stole from the govt forms example, I had no > idea what to use. > > When I click my "show pdf" button, the PDF loads, but the fields are > empty, of course. There's no way it can work unless i make some kind > of mapping between empty fields in the PDF file and values in my > instance. I couldn't see anywhere this was done in the govt forms > example. Is that what those coordinates are for? If so, where do > they come from? I couldn't find anything like that in adobe designer, > I assumed I'd use the Adobe's field names. Not so? Does the > pdf-template code just overlay stuff right on the pdf without regard to > > Thanks for any help you can offer me here. > > Oh yeah, would you happen to know what classes I can enable debug for, > that might shed more light on what's happening? > > Thanks again. > -Jeff > > > Erik Bruchez wrote: >> >> Jeff, >> >> Unfortunately there is no doc on this at the moment. I thought we had >> a bug about this but couldn't find it. Here is a new one: >> >> http://forge.objectweb.org/tracker/index.php?func=detail&aid=306992&g >> roup_id=168&atid=350207 >> >> In the Government form, things are glued together in the page flow >> with this entry: >> >> <page id="pdf-detail" path-info="/forms/pdf-detail/([^/]+)/([^/]+)" >> matcher="oxf:perl5-matcher" >> default-submission="detail/parameters.xml" >> view="detail/pdf-detail-view.xpl"> >> <setvalue ref="/parameters/form-id" matcher-group="1"/> >> <setvalue ref="/parameters/document-id" matcher-group="2"/> >> </page> >> >> -Erik >> >> weissjeffm wrote: >>> Hello, >>> >>> I've worked out from the tutorial how to create my own forms. Now I >>> want to render the data from the forms in a PDF, exactly the way the >>> Government Forms example does it. >>> >>> I can't quite figure out how it works, though. I see the >>> pdf-detail-view.xpl, and the pdf-template.xml. What I'm not sure of >>> is how they are used, I find it difficult to figure out where the >>> magic happens. >>> >>> Can someone point me to some documentation, or actually what would >>> be fantastic is if there was a "hello world" example of this. A >>> 1-field form, and a view button that populates a 1-field pdf >>> tempate. >>> >>> Any pointers would be much appreciated. >>> Thanks, >>> Jeff >>> >>> >> >> >> -- >> Orbeon Forms - Web Forms for the Enterprise Done the Right Way >> http://www.orbeon.com/ >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws >> >> > > View this message in context: http://www.nabble.com/PDF-template-docs-or-simple-example--tf3680611.html#a1 0399608 Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alexander Žaťko
No, it's not ignoring the attributes, it works. I was expecting it to work differently, I hoped I wasn't required to specify coordinates, that I could instead specify something like 'name="textfieldX"' and it would put the value into that textfield, no matter where it was.
Looks like I'll have to add that myself if I want it. I've seen the source of PDFProcessor, it shouldn't be all that difficult. But I won't know for sure until i try it.
|
In reply to this post by Greg Jones-4
According to this:
http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg24776.html and this: http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg30911.html iText is not designed to fill in anything but static forms. I want dynamic forms (where the number and size of fields expands to fit the data). So I am going to give up on the pdf-template and pursue some other method. My requirement to use PDFs isn't written in stone, so I think I'm going to do the simplest thing and just style the XML into HTML. The problem here is that the documents won't look so great when printed. I might have to live with that. Unless anyone else has other ideas on how to turn XML into a document designed for printing?
|
You are right - the pdf-template processor is built to process only very simple templates. Did you take a look at the XSL-FO converter? You are also talking about a need to build dynamic forms. PDF format allows form objects - fields (and form filling), but I do not think this is what you are after - right? I think you have a need to build PDF files from XML instances that might conform to the same schema, but the individual instances would contain different subsets of nodes. I assume this is the reason why the pdf-template processor is not working for you, because to account for all of the XML instance variations the common schema would allow would require you to design a PDF template that: 1) contains placeholders (field elements) for all nodes in the schema 2) painstakingly create code in your XPL that would take care of closing white spaces (by dynamically setting the position of the field elements) on the result document that would appear if any of the placeholders do not receive data during composition. This function is generally built into more powerful composition engines, but they are also quite expensive (Pageflex for example) A. On May 10, 2007, at 8:20 PM, weissjeffm wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by weissjeffm
Jeff,
> According to this: > http://www.mail-archive.com/itext-questions@.../msg24776.html > and this: > http://www.mail-archive.com/itext-questions@.../msg30911.html > > iText is not designed to fill in anything but static forms. I want dynamic > forms (where the number and size of fields expands to fit the data). So I > am going to give up on the pdf-template and pursue some other method. > > My requirement to use PDFs isn't written in stone, so I think I'm going to > do the simplest thing and just style the XML into HTML. The problem here is > that the documents won't look so great when printed. I might have to live > with that. > > Unless anyone else has other ideas on how to turn XML into a document > designed for printing? the content of the data, using PDF templates is definitely not the solution for you. You could instead either generate PDF dynmically, for example with the XSL-FO processor, or use HTML, or Word. The PDF Template processor is designed to be a very simple but very effective solution based on templates. Many organizations have existing paper forms (which necessarily have a static structure - at least until we have electronic paper ;-). They also often have PDF documents (or Word documents that can easily be converted into PDF) as a source for the printed forms. This is the main use case targeted by the PDF Template processor: leveraging these existing forms. (The other use case is that you create such a template from scratch.) This solution is incredibly faster than pretty much any other we have seen: you can really build a complete and good-looking PDF form in an hour or two, as opposed to, well, much more to create a dynamically laid out document. Of course, it doesn't work in all cases, especially when you have variable quantities of information that need adjusting the layout. -Erik -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Thanks for that explanation.
I don't have the constraint that I have to use an existing form. But I do have the constraint that I have dynamic content. So yeah, I see now that pdf-template isn't for me. So, I am looking at xsl-fo right now, and it looks like it will work. However, the task of writing this xsl form in a plain xml editor seems daunting. A UI editor would be nice. We own a lot of Adobe products, do any of them help produce xsl-fo? I would think it would be part of livecycle designer, if it existed, but I don't think it's there. I know there's the alternative of using Adobe server products, but I don't want to take on the role of administrating them. Tomcat + ops is a lot lighter-weight :) Jeff
|
Administrator
|
Jeff,
I don't know if Adobe has any support for XSL-FO. My guess is not, given their track record on standards others than PostScript and PDF (which they created). Just my opinion ;-) -Erik weissjeffm wrote: > Thanks for that explanation. > > I don't have the constraint that I have to use an existing form. But I do > have the constraint that I have dynamic content. So yeah, I see now that > pdf-template isn't for me. > > So, I am looking at xsl-fo right now, and it looks like it will work. > However, the task of writing this xsl form in a plain xml editor seems > daunting. > > A UI editor would be nice. We own a lot of Adobe products, do any of them > help produce xsl-fo? I would think it would be part of livecycle designer, > if it existed, but I don't think it's there. I know there's the alternative > of using Adobe server products, but I don't want to take on the role of > administrating them. Tomcat + ops is a lot lighter-weight :) > > Jeff > > > > Erik Bruchez wrote: >> Jeff, >> >>> According to this: >>> http://www.mail-archive.com/itext-questions@.../msg24776.html >>> and this: >>> http://www.mail-archive.com/itext-questions@.../msg30911.html >>> >>> iText is not designed to fill in anything but static forms. I want >>> dynamic >>> forms (where the number and size of fields expands to fit the data). So >>> I >>> am going to give up on the pdf-template and pursue some other method. >>> >>> My requirement to use PDFs isn't written in stone, so I think I'm going >>> to >>> do the simplest thing and just style the XML into HTML. The problem here >>> is >>> that the documents won't look so great when printed. I might have to >>> live >>> with that. >>> >>> Unless anyone else has other ideas on how to turn XML into a document >>> designed for printing? >> If you mean that you want to adjust the layout of the page according to >> the content of the data, using PDF templates is definitely not the >> solution for you. >> >> You could instead either generate PDF dynmically, for example with the >> XSL-FO processor, or use HTML, or Word. >> >> The PDF Template processor is designed to be a very simple but very >> effective solution based on templates. Many organizations have existing >> paper forms (which necessarily have a static structure - at least until >> we have electronic paper ;-). >> >> They also often have PDF documents (or Word documents that can easily be >> converted into PDF) as a source for the printed forms. This is the main >> use case targeted by the PDF Template processor: leveraging these >> existing forms. (The other use case is that you create such a template >> from scratch.) >> >> This solution is incredibly faster than pretty much any other we have >> seen: you can really build a complete and good-looking PDF form in an >> hour or two, as opposed to, well, much more to create a dynamically laid >> out document. >> >> Of course, it doesn't work in all cases, especially when you have >> variable quantities of information that need adjusting the layout. >> >> -Erik >> >> -- >> Orbeon Forms - Web Forms for the Enterprise Done the Right Way >> http://www.orbeon.com/ >> >> >> >> -- >> You receive this message as a subscriber of the [hidden email] >> mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Adobe Document Server templates used to based of XSL-FO, but
according to this: http://www.adobe.com/products/server/documentserver/pdfs/ docserver_mig_faq.pdf ..LiveCycle (which took place of discontinued ADS in the Adobe offerings) uses different document-producing technology. A. On May 14, 2007, at 9:04 PM, Erik Bruchez wrote: > Jeff, > > I don't know if Adobe has any support for XSL-FO. My guess is not, > given their track record on standards others than PostScript and > PDF (which they created). Just my opinion ;-) > > -Erik > > weissjeffm wrote: >> Thanks for that explanation. I don't have the constraint that I >> have to use an existing form. But I do >> have the constraint that I have dynamic content. So yeah, I see >> now that >> pdf-template isn't for me. >> So, I am looking at xsl-fo right now, and it looks like it will >> work. However, the task of writing this xsl form in a plain xml >> editor seems >> daunting. >> A UI editor would be nice. We own a lot of Adobe products, do any >> of them >> help produce xsl-fo? I would think it would be part of livecycle >> designer, >> if it existed, but I don't think it's there. I know there's the >> alternative >> of using Adobe server products, but I don't want to take on the >> role of >> administrating them. Tomcat + ops is a lot lighter-weight :) >> Jeff >> Erik Bruchez wrote: >>> Jeff, >>> >>>> According to this: http://www.mail-archive.com/itext- >>>> [hidden email]/msg24776.html >>>> and this: >>>> http://www.mail-archive.com/itext- >>>> [hidden email]/msg30911.html >>>> >>>> iText is not designed to fill in anything but static forms. I want >>>> dynamic >>>> forms (where the number and size of fields expands to fit the >>>> data). So >>>> I >>>> am going to give up on the pdf-template and pursue some other >>>> method. >>>> My requirement to use PDFs isn't written in stone, so I think >>>> I'm going >>>> to >>>> do the simplest thing and just style the XML into HTML. The >>>> problem here >>>> is >>>> that the documents won't look so great when printed. I might >>>> have to >>>> live >>>> with that. >>>> >>>> Unless anyone else has other ideas on how to turn XML into a >>>> document >>>> designed for printing? >>> If you mean that you want to adjust the layout of the page >>> according to the content of the data, using PDF templates is >>> definitely not the solution for you. >>> >>> You could instead either generate PDF dynmically, for example >>> with the XSL-FO processor, or use HTML, or Word. >>> >>> The PDF Template processor is designed to be a very simple but >>> very effective solution based on templates. Many organizations >>> have existing paper forms (which necessarily have a static >>> structure - at least until we have electronic paper ;-). >>> >>> They also often have PDF documents (or Word documents that can >>> easily be converted into PDF) as a source for the printed forms. >>> This is the main use case targeted by the PDF Template processor: >>> leveraging these existing forms. (The other use case is that you >>> create such a template from scratch.) >>> >>> This solution is incredibly faster than pretty much any other we >>> have seen: you can really build a complete and good-looking PDF >>> form in an hour or two, as opposed to, well, much more to create >>> a dynamically laid out document. >>> >>> Of course, it doesn't work in all cases, especially when you have >>> variable quantities of information that need adjusting the layout. >>> >>> -Erik >>> >>> -- >>> Orbeon Forms - Web Forms for the Enterprise Done the Right Way >>> http://www.orbeon.com/ >>> >>> >>> >>> -- >>> You receive this message as a subscriber of the ops- >>> [hidden email] >>> mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: http:// >>> www.objectweb.org/wws >>> >>> > > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.com/ > > > -- > You receive this message as a subscriber of the ops- > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/ > wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |