# How to generate a PDF file from a form’s gridview with Spire.PDF

**URL:** <https://discuss.workflowgen.com/t/how-to-generate-a-pdf-file-from-a-form-s-gridview-with-spire-pdf/299>\
**Category:** Form Designer\
**Created:** [June 13, 2016, 8:10pm UTC](https://discuss.workflowgen.com/t/how-to-generate-a-pdf-file-from-a-form-s-gridview-with-spire-pdf/299 "2016-06-13T20:10:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [June 13, 2016, 8:10pm UTC](https://discuss.workflowgen.com/t/how-to-generate-a-pdf-file-from-a-form-s-gridview-with-spire-pdf/299/1 "2016-06-13T20:10:46Z")

</div>

You can easily integrate PDF document generation into a workflow. This article provides an example of how to use the **Free Spire.PDF** library to generate a PDF file from a form’s gridview, such as the Investment Application process (template) form grid. The generated file will be available as one of the first action’s OUT parameters.

1. Download Free Spire.PDF 3.2 (free version) from [http://www.e-iceblue.com/Download/download-pdf-for-net-free.html](http://www.e-iceblue.com/Download/download-pdf-for-net-free.html).

2. Copy the Free Spire.PDF DLLs (`Spire.Pdf.dll` and `Spire.License.dll`) from the `...\e-iceblue\Spire.pdf-fe\Bin\NET4.0` folder to the `DRIVE:\Inetpub\YOURSITE\wfgen\WfApps\WebForms\Bin` folder.

3. Create a new WorkflowGen process with a grid, such as the Investment Application Process (see below for a download link).

4. Create a `FORM_PDF` process data and set its data type to file. This process data will contain the generated PDF file.

5. Create a new textbox field in the same section as the grid with the ID `PDF`.

6. Hide this textbox for all actions by editing the textbox settings and checking **Hide checkbox for all actions**.

7. On the Mapping screen in the Form Designer, select the first action, and click the **Value OUT** button associated to this new textbox.

8. In the **Existing data** field, select the `FORM_PDF` data.

9. In the code-behind, create your new private `Gridview2PDF` method. In this method, you have to save the generated file name in the `FORM_PDF` process data. This is how the generated file will be accessible from the follow-up form (for more information on this topic, see the [Form designer: How to generate a PDF version of the form archive](https://discuss.workflowgen.com/t/form-designer-how-to-generate-a-pdf-version-of-the-form-archive/) topic).

10. In the code-behind `MySubmitButton_Click` method, call your `Gridview2PDF` method.

11. To test, launch a request using this newly-created process, enter information into the form’s grid, submit the request, go to the follow-up form, and click the link associated to the `FORM_PDF` data description to download the generated PDF file.

Download&nbsp;the [INVESTMENT\_APP\_SPIREPDFv1](https://advantys.box.com/s/1crg8t6s97x31y34gpt1iwnq9o4knll9) process, unzip it, and import the XPDL into WorkflowGen to see it in action.

---

<div class="post-metadata">

**Author:** ![pHumphrey](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pHumphrey](https://discuss.workflowgen.com/u/pHumphrey)\
**Post date:** [November 20, 2018, 1:54pm UTC](https://discuss.workflowgen.com/t/how-to-generate-a-pdf-file-from-a-form-s-gridview-with-spire-pdf/299/2 "2018-11-20T13:54:54Z")

</div>

So the very question I have, can it be done from a fillable form that is in PDF already, like this one: [online-form-builder.pdffiller.com](https://online-form-builder.pdffiller.com/) with Spire?

---

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [November 20, 2018, 10:23pm UTC](https://discuss.workflowgen.com/t/how-to-generate-a-pdf-file-from-a-form-s-gridview-with-spire-pdf/299/3 "2018-11-20T22:23:58Z")

</div>

Hi @pHumphrey,

No, the form needs to be readable so that Spire can take the values of the gridview by taking its datasource and converting it to a PDF file.

Regards,  
Eddy.
