{"id":18990574,"url":"https://github.com/baristalabs/skinny-html2pdf","last_synced_at":"2025-06-22T17:33:03.387Z","repository":{"id":74447195,"uuid":"124793790","full_name":"BaristaLabs/skinny-html2pdf","owner":"BaristaLabs","description":"Dockerified html2pdf Microservice built with dotnetcore","archived":false,"fork":false,"pushed_at":"2018-03-31T06:29:21.000Z","size":68,"stargazers_count":5,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T11:15:41.642Z","etag":null,"topics":["aspnet-core","docker","dotnet-core","headless-chrome","html2pdf","microservice"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaristaLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-11T20:01:47.000Z","updated_at":"2023-09-08T17:37:46.000Z","dependencies_parsed_at":"2023-07-29T04:15:57.802Z","dependency_job_id":null,"html_url":"https://github.com/BaristaLabs/skinny-html2pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaristaLabs/skinny-html2pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaristaLabs%2Fskinny-html2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaristaLabs%2Fskinny-html2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaristaLabs%2Fskinny-html2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaristaLabs%2Fskinny-html2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaristaLabs","download_url":"https://codeload.github.com/BaristaLabs/skinny-html2pdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaristaLabs%2Fskinny-html2pdf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259905430,"owners_count":22929917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnet-core","docker","dotnet-core","headless-chrome","html2pdf","microservice"],"created_at":"2024-11-08T17:10:27.093Z","updated_at":"2025-06-15T00:35:13.360Z","avatar_url":"https://github.com/BaristaLabs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Skinny Html2PDF\n======\n\nSkinny Html2PDF is a .Net Core 2.1 based microservice that converts Html to PDF using [chrome-dev-tools-runtime](https://github.com/BaristaLabs/chrome-dev-tools-runtime) to automate headless chrome.\n\nThis project also contains a dockerfile that will build and run the microservice in a minimal environment.\n\nWhile perhaps interesting in itself, some effort was made to make this stack 'skinny':\n\n - Built using .Net Core 2.1 (Preview) (2.1 is skinner than 2.0)\n - Docker image based on Alpine Linux (Alpine is skinner than standard debian)\n - TODO: Tree Trimming tools (seems to be broken in current Alpine)\n - TODO: https://github.com/docker-slim/docker-slim\n\nImage size without Chrome: 150mb. With Chrome: 600mb (232mb compressed)\n(Of course, Chrome is required, this metric is just to illustrate the base vs base + chrome image size)\n\nErm, so uh, while this started out as skinny html2pdf, the size with Chrome and its dependencies makes things a tad pudgy 'round the middle; Grande, if you will. Still, not bad for an entire OS + .Net Core + Chrome.\n\nOne might separate chromium from the rest of the stack and have a swarm/k8s of chrome-only containers allowing for multi-purpose use. *that* would be interesting. 'Browser Cloud'\n\nAnyway, the all-in-one image is available on docker hub here: https://hub.docker.com/r/oceanswave/skinny-html2pdf/\n\n### Getting Started\n---\n[Docker](https://www.docker.com/get-docker) must be installed and running.\n\n``` bash\ndocker pull oceanswave/skinny-html2pdf\ndocker run -d -p 80:8080 --shm-size=1gb --cap-add SYS_ADMIN oceanswave/skinny-html2pdf\n```\n\nOnce the container is running, the services will be hosted at localhost:80 and exposes the following endpoints:\n\nhttp://localhost/api/html2pdf?url=https://medium.com/netflix-techblog/embracing-the-differences-inside-the-netflix-api-redesign-15fd8b3dc49d\u0026fileName=myarticle.pdf\n\nParameters:\n - url: full uri of the web page to render\n - width: Width in pixels of the page to render\n - height: Height in pixels of the page to render\n - filename: content-disposition filename value\n - landscape: true to output in landscape\n \nhttp://localhost/api/html2image?url=https://www.pexels.com/photo/white-and-yellow-flower-with-green-stems-36764/\n\nParameters:\n - url: full uri of the web page to render\n - width: Width in pixels of the page to render\n - height: Height in pixels of the page to render\n - filename: content-disposition filename value\n\nThe service also supports ad-hoc conversion of Html to PDF.\n\nSimply POST to http://localhost/api/html2pdf with the body containing of the HTML to convert into PDF.\n\nParameters:\n - width: Width in pixels of the page to render\n - height: Height in pixels of the page to render\n - filename: content-disposition filename value\n - landscape: true to output in landscape mode\n\n### Hosting on Azure\n---\n\nGenerally, follow the instructions on https://docs.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image\n\nWithin the Azure Cloud Shell:\n\n``` Powershell\naz group create --name skinnyHtml2PdfResourceGroup --location \"East US 2\"\naz appservice plan create --name skinnyHtml2PdfServicePlan --resource-group skinnyHtml2PdfResourceGroup --sku B1 --is-linux\naz webapp create --resource-group skinnyHtml2PdfResourceGroup --plan skinnyHtml2PdfServicePlan --name skinny-html2pdf --deployment-container-image-name oceanswave/skinny-html2pdf:latest\n```\n\n### Development\n---\n\nVS2017 15.6+. As .Net Core 2.1 is still in development, the .Net Core 2.1 Preview SDK must be downloaded and installed. \n\nThe latest version of Chromium available for Alpine at the time of this writing is Chrome 64, so chrome-dev-tools-runtime should not be upgraded to latest.\n\nBuild using docker-compose:\n\n``` bash\ngit clone https://github.com/baristalabs/skinny-html2pdf\ncd skinny-html2pdf\ndocker-compose build\ndocker-compose up -d\n```\n\nThe microservice can be built without docker-compose as well.\n\n``` bash\ngit clone https://github.com/baristalabs/skinny-html2pdf\ncd skinny-html2pdf\ndocker build -rm -t oceanswave/skinnyhtml2pdf:latest -f BaristaLabs.SkinnyHtml2Pdf.Web/Dockerfile .\ndocker run -d -p 80:8080 --shm-size=1gb --cap-add SYS_ADMIN oceanswave/skinny-html2pdf\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaristalabs%2Fskinny-html2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaristalabs%2Fskinny-html2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaristalabs%2Fskinny-html2pdf/lists"}