Greetings,
I recently started looking into the possibility to migrate our PHP-based web forms to Orbeon, but as not being an XML programmer, I'm having some difficulty in configuring the pdf-template processor and couldn't find any clue from the documentation. Could someone may offer some help? What I wish to do is to submit the following simple instance to the pdf-template processor and render the text on a very simple pdf file: The instance: <xforms:instance id="pdf-instance" xmlns=""> <field-data> <first-name>John</first-name> <last-name>Smith</last-name> </field-data> </xforms:instance> in my page flow, I have: <page path-info="/pdf-test/make-pdf"> <action action="make-pdf.xpl"/> </page> and I have a pdf-template.xml that looks like: <config xmlns:st="pdf-test"> <template href="oxf:/apps/hwhite/hwhite.pdf" show-grid="false"/> <field left="100" top="100" size="20" value="st:first-name"/> <field left="150" top="150" size="20" value="st:last-name"/> </config> Could someone may let me know how can I compose the xpl file to connect the above components and make them to work? I suppose in my make-pdf.xpl, there might be something like: <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <p:param name="instance" type="input"/> <!-- Produce PDF document --> <p:processor name="oxf:pdf-template"> <p:input name="instance" href="#instance"/> <p:input name="model" href="oxf:pdf-template.xml"/> <!-- TODO: Remove this input --> <p:input name="config"><config/></p:input> <p:output name="data" ref="data"/> </p:processor> </p:config> Thanks in advance! Jason > I posted this message to the mailing group a few hours ago but it didn't appear. Have to send it again and my apology if you receive duplicated messages. < -- 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 |
Administrator
|
Jason,
We do need some more documentation on this processor. First, you seem to have a namespace issue: your field-data, first-name and last-name elements in XForms are in no namespace (xmlns=""), but you try to address them in the "pdf-test" namespace in the PDF template (st:first-name, etc.). Second, you need to use a proper path to access the data, i.e. /field-data/first-name, etc. Try something like this: <config xmlns:st="pdf-test"> <template href="oxf:/apps/hwhite/hwhite.pdf" show-grid="false"/> <group ref="/field-data"> <field left="100" top="100" size="20" value="first-name"/> <field left="150" top="150" size="20" value="last-name"/> </group> </config> -Erik [hidden email] wrote: > Greetings, > > I recently started looking into the possibility to migrate our > PHP-based web forms to Orbeon, but as not being an XML programmer, I'm > having some difficulty in configuring the pdf-template processor and > couldn't find any clue from the documentation. Could someone may offer > some help? > > What I wish to do is to submit the following simple instance to the > pdf-template processor and render the text on a very simple pdf file: > > The instance: > <xforms:instance id="pdf-instance" xmlns=""> > <field-data> > <first-name>John</first-name> > <last-name>Smith</last-name> > </field-data> > </xforms:instance> > > in my page flow, I have: > > <page path-info="/pdf-test/make-pdf"> > <action action="make-pdf.xpl"/> > </page> > > and I have a pdf-template.xml that looks like: > <config xmlns:st="pdf-test"> > <template href="oxf:/apps/hwhite/hwhite.pdf" show-grid="false"/> > <field left="100" top="100" size="20" value="st:first-name"/> > <field left="150" top="150" size="20" value="st:last-name"/> > </config> > > Could someone may let me know how can I compose the xpl file to > connect the above components and make them to work? I suppose in my > make-pdf.xpl, there might be something like: > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:delegation="http://orbeon.org/oxf/xml/delegation" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > <p:param name="instance" type="input"/> > > <!-- Produce PDF document --> > <p:processor name="oxf:pdf-template"> > <p:input name="instance" href="#instance"/> > <p:input name="model" href="oxf:pdf-template.xml"/> > <!-- TODO: Remove this input --> > <p:input name="config"><config/></p:input> > <p:output name="data" ref="data"/> > </p:processor> > </p:config> > > Thanks in advance! > Jason > >> I posted this message to the mailing group a few hours ago but it didn't > appear. Have to send it again and my apology if you receive duplicated > messages. < > -- 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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |