# I am looking to generate PDFs with the filled out forms

**URL:** <https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168>\
**Category:** General\
**Created:** [March 5, 2021, 4:21pm UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168 "2021-03-05T16:21:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [March 5, 2021, 4:21pm UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/1 "2021-03-05T16:21:45Z")

</div>

Is there a way to generate HTML in nodejs using the schema, uischema, data? I want it to look the same as the materialRenderers. The basic concept is to display the forms and let people fill them out and persist all pieces in the DB and then be able to print the form as a PDF.

_[[original thread](https://spectrum.chat/jsonforms/general/i-am-looking-to-generate-pdfs-with-the-filled-out-forms~14f63c2b-3f5a-4e4a-8a5d-6559fa8b59a4) by shua Talansky]_

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [March 5, 2021, 4:48pm UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/2 "2021-03-05T16:48:56Z")

</div>

Isn’t the regular approach of developing a React app sufficient? For example take a look at the [React seed](https://github.com/eclipsesource/jsonforms-react-seed). All you need to do is to build in some communication to your backend (for example via REST), run `npm run build` and serve the output from any webserver.

---

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [March 5, 2021, 5:41pm UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/3 "2021-03-05T17:41:08Z")

</div>

_[shua Talansky]_

Let me explain better. If I want to render it as HTML I need it to look identical to what the client sees on his screen but I want it to be a server process that generates this markup to create a PDF out of it and email it to the client.  
Below is a component that is passed to ReactDOMServer.renderToString I get the following error and it does not render Warning: useLayoutEffect does nothing on the server

```auto
<JsonForms
      schema={schema}
      uischema={uischema}
      data={data}
      renderers={renderers}
      cells={materialCells}
      onChange={({ data, _errors }) => setData(data)}
    />

```

---

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/discobot/32/3_2.png) [@discobot](https://jsonforms.discourse.group/u/discobot)\
**Post date:** [March 7, 2021, 3:03am UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/4 "2021-03-07T03:03:59Z")

</div>

_[shua Talansky]_

@sdirix(sdirix) I appreciate your interest in my question. Do you understand my question? Any other thoughts?

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [March 8, 2021, 8:17am UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/5 "2021-03-08T08:17:15Z")

</div>

Whether you use server side rendering or not doesn’t change anything in principle. Either way you need to get the data back to the server for further processing, in your case to create a PDF.

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [March 8, 2021, 8:18am UTC](https://jsonforms.discourse.group/t/i-am-looking-to-generate-pdfs-with-the-filled-out-forms/168/6 "2021-03-08T08:18:44Z")

</div>

Regarding server side rendering:

- Material UI is not that easy to render on the server as it requires certain media queries to be available. You’ll need to mock them to render anything

- When you get `useLayoutEffect` warnings then you’re on an older version of JSON Forms. Please update to 2.5.0
