How can I make a module that I can call from any API so that it makes me a PDF with DomPdf?
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:
- Create a new app
- Include DomPDF as a dependency
- Define a controller that accepts an URL (probably a POST)
- Call DomPDF and store the data in the NC storage
- 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
I need to use it from 3rdparty
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.
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.
Thank you so much and sorry
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).
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.