{"id":16296928,"url":"https://github.com/ahwayakchih/node-pdf-print-server","last_synced_at":"2025-04-05T21:32:05.336Z","repository":{"id":66587513,"uuid":"229820483","full_name":"ahwayakchih/node-pdf-print-server","owner":"ahwayakchih","description":"Use node.js and puppeteer to create PDF files from websites on demand","archived":false,"fork":false,"pushed_at":"2020-01-04T14:33:58.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T11:11:23.585Z","etag":null,"topics":["print-pdf","server","url-to-pdf"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahwayakchih.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-23T20:45:18.000Z","updated_at":"2022-05-10T09:08:17.000Z","dependencies_parsed_at":"2023-03-05T04:45:40.153Z","dependency_job_id":null,"html_url":"https://github.com/ahwayakchih/node-pdf-print-server","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/ahwayakchih%2Fnode-pdf-print-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahwayakchih%2Fnode-pdf-print-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahwayakchih%2Fnode-pdf-print-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahwayakchih%2Fnode-pdf-print-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahwayakchih","download_url":"https://codeload.github.com/ahwayakchih/node-pdf-print-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406028,"owners_count":20933803,"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":["print-pdf","server","url-to-pdf"],"created_at":"2024-10-10T20:24:28.206Z","updated_at":"2025-04-05T21:32:05.330Z","avatar_url":"https://github.com/ahwayakchih.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"PDF Print server\n================\n\nRun a simple HTTP server, that awaits requests with URL parameter, loades website from that URL and respondes with PDF file.\n\n## Requirements\n\nThis project depends on [Node.js](https://nodejs.org/) v12+.\n\nIt also depends on Chrome or Chromium browser. If you do not want to install additional Chrome with this module, make sure that there is a `CHROME_BIN` environmental variable set, pointing to browser executable.\n\nYou can also run it using Docker or Podman, in which case no installation will be necessary (skip the \"Installation\" step).\n\n## Installation\n\nSince this is a private project (at least at the moment), clone it, go to its directory and install it:\n\n```sh\ngit clone git@github.com:ahwayakchih/node-pdf-print-server.git\ncd node-pdf-print-server\nnpm install --production\n```\n\nIf you have Chrome or Chromium browser enabled, set `CHROME_BIN` environment variable pointing to its executable and install \"thin\" version of `puppeteer` module:\n\n```sh\nnpm install --no-save puppeteer-core\n```\n\nOtherwise, install \"full\" version of `puppeteer` module (which will include local installation of Chrome browser):\n\n```sh\nnpm install --no-save puppeteer\n```\n\n## Starting server (native)\n\nStart server from command line:\n\n```sh\nnpm start 0.0.0.0:8080\n```\n\nThat will start server listening for connections on any hostname, on port `8080`.\n\nIf you want to hide it behind some reverse-proxy (that could also serve as SSL terminator), you can run server as localhost only instead:\n\n```sh\nnpm start localhost:8080\n```\n\n## Starting server (docker)\n\n```sh\ndocker run --rm -v ~/www/pdf-printer:/app -p 8080:8080 -it ahwayakchih/nodeapp:puppeteer /bin/sh -c \"npm install --production \u0026\u0026 npm start 0.0.0.0:8080\"\n```\n\n## Starting server (podman)\n\n```sh\npodman run --rm --userns=keep-id -v ./:/app -p 8080:8080 -it ahwayakchih/nodeapp:puppeteer /bin/sh -c \"npm install --production \u0026\u0026 npm start 0.0.0.0:8080\"\n```\n\n## Usage\n\nSimply request server by passign additional `url` query parameter:\n\n```sh\ncurl -o test.pdf http://localhost:8080/?url=https://nodejs.org\n```\n\nor `x-print-pdf-url` HTTP header:\n\n```sh\ncurl -o test.pdf -H 'x-print-pdf-url: https://nodejs.org' http://localhost:8080\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahwayakchih%2Fnode-pdf-print-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahwayakchih%2Fnode-pdf-print-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahwayakchih%2Fnode-pdf-print-server/lists"}