Re: Re: Create pdf of form

Posted by JohnBampton on
URL: https://discuss.orbeon.com/Create-pdf-of-form-tp44595p44600.html

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.

parisiana wrote
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"/>

   
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission">
            <xforms:submission serialization="none" method="get"
xxforms:username="admin" xxforms:password=""
                action="
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>

   
    <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 <jbampton@gmail.com> wrote:

>
> 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!
>
>
>
> JohnBampton wrote:
> >
> > 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.
> >
> >
> >
> >
> > Alexander Žaťko wrote:
> >>
> >> 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 ops-users@ow2.org
> >>> mailing list.
> >>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> >>> For general help: mailto:sympa@ow2.org?subject=help
> >>> OW2 mailing lists service home page: http://www.ow2.org/wws
> >>
> >>
> >>
> >> --
> >> You receive this message as a subscriber of the ops-users@ow2.orgmailing
> >> list.
> >> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> >> For general help: mailto:sympa@ow2.org?subject=help
> >> OW2 mailing lists service home page: http://www.ow2.org/wws
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Create-pdf-of-form-tp25090313p25100916.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing
> list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws