{"id":21258925,"url":"https://github.com/microfleet/html-to-pdf","last_synced_at":"2025-08-01T16:44:00.338Z","repository":{"id":22594161,"uuid":"95514477","full_name":"microfleet/html-to-pdf","owner":"microfleet","description":"Renders mustache template to HTML and then creates PDF in headless chrome - useful for generating PDF reports with rich formatting","archived":false,"fork":false,"pushed_at":"2025-06-10T03:42:33.000Z","size":939,"stargazers_count":5,"open_issues_count":36,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T07:08:05.442Z","etag":null,"topics":["headless-chrome","html-to-pdf","microfleet","microservices","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microfleet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-06-27T03:38:32.000Z","updated_at":"2024-08-06T14:33:39.000Z","dependencies_parsed_at":"2023-11-16T14:42:29.525Z","dependency_job_id":"76f3b802-0f76-406c-b46e-64c7e58d9be3","html_url":"https://github.com/microfleet/html-to-pdf","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/microfleet/html-to-pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfleet%2Fhtml-to-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfleet%2Fhtml-to-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfleet%2Fhtml-to-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfleet%2Fhtml-to-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microfleet","download_url":"https://codeload.github.com/microfleet/html-to-pdf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microfleet%2Fhtml-to-pdf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262614456,"owners_count":23337277,"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":["headless-chrome","html-to-pdf","microfleet","microservices","nodejs"],"created_at":"2024-11-21T04:11:28.375Z","updated_at":"2025-06-29T15:04:11.627Z","avatar_url":"https://github.com/microfleet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @microfleet/html-to-pdf\n\n\u003cimg alt=\"Microfleet PDF\" src=\"https://raw.githubusercontent.com/microfleet/html-to-pdf/master/assets/mf-concept-pdf.png\" width=\"412\" height=\"208\" /\u003e\n\nHTML to PDF @microfleet service is designed to render any provided mustache template with arbitrary context and is able to send back base64 encoded PDF or upload id in case of integration with @microfleet/files\n\n## Configuration\n\n* Consult with [@microfleet/core](https://github.com/microfleet/core) for generic configuration\n* [configuration schema](schemas/config.json) - service configuration options\n\nBy default delayed-retry on Quality of Service is enabled, which effectively retries actions when\nunexpected errors occur up to 5 times by default with exponential delay.\n\n## API\n\nDescription of available API methods\n\n### `pdf.render`\n\nRenders `mustache` template with passed context, feeds that document to Chrome \u0026 save it as PDF. Then uploads it to storage of choice using [@microfleet/files](https://github.com/makeomatic/ms-files) or returns PDF as base64 encoded data\n\nFollowing params are accepted:\n\n```js\n{\n  \"template\": \"name-of-the-template-to-render\",\n  \"context\": {\n    ... // arbitrary object with data thats passed to template for rendering\n  },\n  \"documentOptions\": {\n    ... // chrome's printToPdf document options - https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF\n  },\n  \"meta\": {\n    ... // can be boolean `false` to turn off @microfleet/files integration\n    ... // or can be an object defining the upload\n  },\n}\n```\n\nFor a detailed description of API params look at [validation schema](schemas/render.json)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofleet%2Fhtml-to-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrofleet%2Fhtml-to-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofleet%2Fhtml-to-pdf/lists"}