# DomPdf in nextcloud

**URL:** <https://help.nextcloud.com/t/dompdf-in-nextcloud/219776>\
**Category:** 💻 Development\
**Created:** [March 12, 2025, 12:12pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776 "2025-03-12T12:12:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduardo\_Medina](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eduardo_medina/32/63036_2.png) [@Eduardo\_Medina](https://help.nextcloud.com/u/Eduardo_Medina)\
**Post date:** [March 12, 2025, 12:12pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/1 "2025-03-12T12:12:03Z")

</div>

How can I make a module that I can call from any API so that it makes me a PDF with DomPdf?

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [March 13, 2025, 11:20am UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/2 "2025-03-13T11:20:30Z")

</div>

Hello.

I suspect by module, you mean a NC app, right?

What is your use case? The user copies a URL on the web somewhere publicly reachable and the page is downloaded and stored in the NC as PDF?

(Very) short answer:

1. Create a new app
2. Include DomPDF as a dependency
3. Define a controller that accepts an URL (probably a POST)
4. Call DomPDF and store the data in the NC storage
5. Optionally add a user interface

Without more information, there will likely nobody volunteer to make the actual work for you and create/test a complete app.

So: please be explicit, what you need or where you are failing. Then, you might get reasonable answers.

Christian

---

<div class="post-metadata">

**Author:** ![Eduardo\_Medina](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eduardo_medina/32/63036_2.png) [@Eduardo\_Medina](https://help.nextcloud.com/u/Eduardo_Medina)\
**Post date:** [March 13, 2025, 11:49am UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/3 "2025-03-13T11:49:07Z")

</div>

I need to use it from 3rdparty

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [March 13, 2025, 12:10pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/4 "2025-03-13T12:10:40Z")

</div>

Again: Without more information it is (almost) impossible to help you here.

I will no longer try to guess your use case (my glass bulb is broken ATM). Unless you provide more information, I am not going on this request any further.

---

<div class="post-metadata">

**Author:** ![Eduardo\_Medina](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eduardo_medina/32/63036_2.png) [@Eduardo\_Medina](https://help.nextcloud.com/u/Eduardo_Medina)\
**Post date:** [March 13, 2025, 12:25pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/5 "2025-03-13T12:25:29Z")

</div>

I’ve downloaded the dompdf library folder to the 3rdparty folder, and I need to know how to include and use it through Composer. I actually need the steps to install a library in 3rdparty and then use it from any Nextcloud API.

---

<div class="post-metadata">

**Author:** ![Eduardo\_Medina](https://help.nextcloud.com/user_avatar/help.nextcloud.com/eduardo_medina/32/63036_2.png) [@Eduardo\_Medina](https://help.nextcloud.com/u/Eduardo_Medina)\
**Post date:** [March 13, 2025, 12:25pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/6 "2025-03-13T12:25:55Z")

</div>

Thank you so much and sorry

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [March 13, 2025, 12:55pm UTC](https://help.nextcloud.com/t/dompdf-in-nextcloud/219776/7 "2025-03-13T12:55:48Z")

</div>

You do not modify the fodler 3rdparty in the NC root folder. This is reseved for the core.  
You can use composer to install whatever version of the `dompdf/dompdf` dependency you like. This will be put in `vendor` typically inside your working folder (aka your app folder).

> [@Eduardo\_Medina](#):
>
> use it from any Nextcloud API

What do you mean? REST-based API (aka you can access from the web)? I already told you (Controller + link things together). Something else (e.g. in PHP or whatever), you have to be more verbose than just the unclear statement.
