{"id":13651244,"url":"https://github.com/olivmonnier/moleculer-pdf","last_synced_at":"2026-01-12T08:36:37.458Z","repository":{"id":35113042,"uuid":"208288370","full_name":"olivmonnier/moleculer-pdf","owner":"olivmonnier","description":"Moleculer service to generate PDF","archived":false,"fork":false,"pushed_at":"2023-01-05T22:38:28.000Z","size":577,"stargazers_count":10,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T04:38:03.761Z","etag":null,"topics":["microservices","moleculer","pdf","puppeteer"],"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/olivmonnier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-13T15:04:09.000Z","updated_at":"2023-05-25T10:01:11.000Z","dependencies_parsed_at":"2023-01-15T14:05:35.936Z","dependency_job_id":null,"html_url":"https://github.com/olivmonnier/moleculer-pdf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivmonnier%2Fmoleculer-pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivmonnier%2Fmoleculer-pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivmonnier%2Fmoleculer-pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olivmonnier%2Fmoleculer-pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olivmonnier","download_url":"https://codeload.github.com/olivmonnier/moleculer-pdf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333879,"owners_count":21413472,"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":["microservices","moleculer","pdf","puppeteer"],"created_at":"2024-08-02T02:00:47.052Z","updated_at":"2026-01-12T08:36:37.453Z","avatar_url":"https://github.com/olivmonnier.png","language":"JavaScript","funding_links":[],"categories":["Services"],"sub_categories":["Others"],"readme":"![Moleculer logo](http://moleculer.services/images/banner.png)\n\n[![Build Status](https://travis-ci.org/olivmonnier/moleculer-pdf.svg?branch=master)](https://travis-ci.org/olivmonnier/moleculer-pdf)\n[![Coverage Status](https://coveralls.io/repos/github/olivmonnier/moleculer-pdf/badge.svg?branch=master)](https://coveralls.io/github/olivmonnier/moleculer-pdf?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/\u003c----hash-----\u003e)](https://www.codacy.com/app/\u003c---username----\u003e/moleculer-pdf?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=olivmonnier/moleculer-pdf\u0026amp;utm_campaign=Badge_Grade)\n[![Code Climate](https://codeclimate.com/github/olivmonnier/moleculer-pdf/badges/gpa.svg)](https://codeclimate.com/github/olivmonnier/moleculer-pdf)\n[![David](https://img.shields.io/david/olivmonnier/moleculer-pdf.svg)](https://david-dm.org/olivmonnier/moleculer-pdf)\n[![Known Vulnerabilities](https://snyk.io/test/github/olivmonnier/moleculer-pdf/badge.svg)](https://snyk.io/test/github/olivmonnier/moleculer-pdf)\n[![Join the chat at https://gitter.im/moleculerjs/moleculer](https://badges.gitter.im/moleculerjs/moleculer.svg)](https://gitter.im/moleculerjs/moleculer?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n# moleculer-pdf [![NPM version](https://img.shields.io/npm/v/moleculer-pdf.svg)](https://www.npmjs.com/package/moleculer-pdf)\n\nMoleculer service to generate PDF\n\n## Features\n\n## Install\n```\nnpm install moleculer-pdf --save\n```\n\n## Usage\n\n```js\n'use strict';\n\nlet { ServiceBroker } = require(\"moleculer\");\nlet PDFService = require(\"../../index\");\nconst { promisify } = require(\"util\");\nconst { writeFile } = require(\"fs\");\nconst writeFileAsync = promisify(writeFile);\n\n// Create broker\nlet broker = new ServiceBroker({\n  logger: console\n});\n\n// Load my service\nbroker.createService(PDFService);\n\n// Start server\nbroker.start().then(() =\u003e {\n  // Call action\n  broker\n    .call(\"pdf.transform\", { html: \"\u003ch1\u003eJohn Doe\u003c/h1\u003e\" })\n    .then(buff =\u003e writeFileAsync(\"./pdf.pdf\", buff))\n    .catch(broker.logger.error);\n});\n```\n\n# Settings\n\n| Property        | Type      | Default                | Description |\n| --------------- | --------- | ---------------------- | ----------- |\n| `puppeteerArgs` | `Object`  | `{ headless: true }`   | Set of configurable options to set on the browser |\n| `options`       | `Object`  | `{ format: 'letter' }` | Set of configurable options to set pdf document   |\n| `remoteContent` | `Boolean` | `true`                 | Content to load on webpage like                   |\n\n# Actions\n\n## `transform`\n\nTransform html to pdf document\n\n### Parameters\n\n| Property | Type     | Default      | Description      |\n| -------- | -------- | ------------ | ---------------- |\n| `html`   | `String` | **required** | The html content |\n\n### Results\n\n**Type:** `Buffer`\n- Generated pdf document\n\n# Methods\n\n## `transform`\n\nTransform html to pdf document\n\n### Parameters\n\n| Property | Type     | Default      | Description      |\n| -------- | -------- | ------------ | ---------------- |\n| `html`   | `String` | -            | The html content |\n\n### Results\n\n**Type:** `Buffer`\n- Generated pdf document\n\n# Test\n```\n$ npm test\n```\n\nIn development with watching\n\n```\n$ npm run ci\n```\n\n# Contribution\nPlease send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.\n\n# License\nThe project is available under the [MIT license](https://tldrlegal.com/license/mit-license).\n\n# Contact\nCopyright (c) 2019 moleculer-pdf\n\n[![@icebob](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@icebob](https://img.shields.io/badge/twitter-Icebobcsi-blue.svg)](https://twitter.com/Icebobcsi)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivmonnier%2Fmoleculer-pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folivmonnier%2Fmoleculer-pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folivmonnier%2Fmoleculer-pdf/lists"}