Hi all,
I was wondering how to create a pdf of the form when the submit button is pressed. I also have to submit to a database/webservice at the same time. The pdf should be output to the browser. Do I have to use the XSL-FO converter? If so how do i do this? I want to take all forms labels and fields into the pdf. Regards, John. |
This might help:
http://wiki.orbeon.com/forms/doc/user-guide/form-builder-user-guide#TOC-PDF-generation ...or you can use the PDF Template processor (just google oxf:pdf- template) in conjunction with some server-based XPL business logic. A. On Aug 22, 2009, at 5:31 AM, JohnBampton wrote: > > Hi all, > > I was wondering how to create a pdf of the form when the submit > button is > pressed. > > I also have to submit to a database/webservice at the same time. > > The pdf should be output to the browser. > > Do I have to use the XSL-FO converter? If so how do i do this? > > I want to take all forms labels and fields into the pdf. > > Regards, > > John. > -- > View this message in context: http://www.nabble.com/Create-pdf-of-form-tp25090313p25090313.html > 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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Actually on the click of a button I want to run and XSLT/XSL-FO template that trasforms the in memory model instance to create a pdf either opening in a new window or as a download.
I already know xslt/xsl-fo so this would be the easiest way for me. How can I do this? Regards, John.
|
Surely someone can show me some example code or a tutorial on how to do this. The problem with all this xforms stuff is that there is so little documentation/tutorials. All I want to do is run a XSL transformation on the click of a button/trigger that will output a pdf based on the instance in memory.
Any ideas? Please help!
|
John,
one way is to author a xpl pipeline processor declared in page-flow like this (following the government forms example): <page id="pdf-detail" path-info="/your-app-name/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> The xpl: <p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xforms="http://www.w3.org/2002/xforms"> <p:param name="instance" type="input"/> <p:param name="data" type="output"/> <!-- Execute REST submission --> <p:processor name="oxf:xforms-submission"> <p:input name="submission"> <xforms:submission serialization="none" method="get" xxforms:username="admin" xxforms:password="" action="<a href="http://localhost:8080/exist/rest/db/orbeon/your-app-name/{/*/form-id}/{/*/document-id}">http://localhost:8080/exist/rest/db/orbeon/your-app-name/{/*/form-id}/{/*/document-id}"/> </p:input> <p:input name="request" href="#instance"/> <p:output name="response" id="document"/> </p:processor> <!-- Produce PDF document --> <p:processor name="oxf:pdf-template"> <p:input name="data" href="#document"/> <p:input name="model" href="#instance#xpointer(doc(concat('../forms/', /*/form-id, '/pdf-model.xml')))"/> <p:output name="data" ref="data"/> </p:processor> </p:pipeline> And you will need to write a pdf-model.xml that uses the coordinates to hold the values. The transformation takes place on a trigger call that can be target="_blank" . HTH -- einar On Sun, Aug 23, 2009 at 9:20 AM, JohnBampton <[hidden email]> 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi thanks for your reponse.
Could you give me an example of the a pdf-model.xml or a link to one. I am new to all of this and have just developed my first form. Regards. John.
|
John,
I found this practical and intuitive: pdf-model.xml <?xml version="1.0" encoding="UTF-8"?> <config> <template href="oxf:/apps/dir/pdf/names.pdf" show-grid="false"/> <!-- set to "true" to show grid --> <group ref="/*" font-pitch="6.1" font-family="Helvetica" font-size="9"> <group ref="names" font-pitch="4.8"> <field left="60" top="300" size="70" value="concat('Hello', substring(name, 1, 70))"/> </group> </group> </config> Merit where merit is due, it's all thanks to Orbeon xforms! -- einar -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |