# Generate a PDF from container elements in the App

**URL:** <https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621>\
**Category:** Ask the community\
**Tags:** pdf\
**Created:** [August 16, 2023, 7:13am UTC](https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621 "2023-08-16T07:13:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thalv](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@thalv](https://community.appfarm.io/u/thalv)\
**Post date:** [August 16, 2023, 7:13am UTC](https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621/1 "2023-08-16T07:13:01Z")

</div>

Hi, we have an analytics page in the app where the requirement is that we are able to export all the graphs to a PDF report. The “print page” functionality is not sufficient, so We were playing around with the idea of assigning each element and Element ID, and convert from canvas to html, before using this to generate the PDF document, however we are facing some difficulties.

Does anyone have any suggestions on how to solve this?

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 16, 2023, 1:11pm UTC](https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621/2 "2023-08-16T13:11:48Z")

</div>

Hi!

It sounds like this article could be of help? The guide also has a link to the setup in Showroom!

> **[Generate a PDF from a Container](https://docs.appfarm.io/how-to/enhance-your-app/generate-pdf-from-container)**

---

<div class="post-metadata">

**Author:** ![thalv](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@thalv](https://community.appfarm.io/u/thalv)\
**Post date:** [August 16, 2023, 1:53pm UTC](https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621/3 "2023-08-16T13:53:17Z")

</div>

Thanks, that is a great guide! We used it and it worked wonders for elements in a single container, but we had some issues with including elements from multiple elements into one PDF. We tried both printing all and appending the elements to one another, but they always got smudged on top of each others.

Do you have any tips for this situation? 🙂

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [August 16, 2023, 2:23pm UTC](https://community.appfarm.io/t/generate-a-pdf-from-container-elements-in-the-app/621/4 "2023-08-16T14:23:10Z")

</div>

Hi,

Sorry, I do not have a general solution to that 😉 But for the example to work, I believe you need all elements to be within a single container, so that the UI for everything is generated and visible (in the viewport, or as part of the vertical scroll of the visible view). That the example does, it to extract the HTML from the visible view from “the given container/div and below in the hierarchy”, and generate a PDF just for that HTML.
