Documentation
DGtalSharp.PDF
DGtalSharp.Pdf is a cross platform .Net component which creates pdf from html. Its based-on Chromium engine and supports latest html/css syntax.
Docker Image
DGtalSharp.Pdf can be self hosted as docker container
Docker Image
Self host docker image html2pdf and use REST endpoints to create Pdf
Pull image
docker pull hisabir/html2pdf
Run docker
docker run -p 80:80 hisabir/html2pdf
Now open url http://localhost/swagger/index.html in browser
Port can be changed using parameter '-p'. Following command will run docker on port 8888
docker run -p 8888:80 hisabir/html2pdf
Now open url http://localhost:8888/swagger/index.html in browser
OpenApi(Swagger) specs can be used to generate pdf from url/html. To create a pdf from url, simply send a request to
http://localhost:8888/api/Pdf/{url}/{fileName}
Note: change url port in above request
To create pdf from url google.com send following request
http://localhost:8888/api/Pdf/google.com
FileName can be passed in url as last parameter. With following request, a Pdf with name 'GoogleDocument.pdf' will be generated/
http://localhost:8888/api/Pdf/google.com/GoogleDocument
Once you are satisfied with library, you can buy and set license key in environment variable 'LicenseKey'
docker run -p 80:80 -e LicenseKey='KEY' -it --rm hisabir/html2pdf
Note: replace 'KEY' with original key received in email
For dev environment, following command can be used
docker run -p 8888:80 -it --rm hisabir/html2pdf