{"id":20409130,"url":"https://github.com/tcorral/pdf-reactor","last_synced_at":"2026-03-06T09:04:08.885Z","repository":{"id":141832422,"uuid":"24245353","full_name":"tcorral/pdf-reactor","owner":"tcorral","description":"Simple exemple how to create an express server that transform an html page to a pdf","archived":false,"fork":false,"pushed_at":"2014-09-19T09:02:10.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T13:07:35.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/tcorral.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":"2014-09-19T21:01:34.000Z","updated_at":"2020-11-23T08:30:03.000Z","dependencies_parsed_at":"2023-03-12T16:45:17.725Z","dependency_job_id":null,"html_url":"https://github.com/tcorral/pdf-reactor","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/tcorral%2Fpdf-reactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fpdf-reactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fpdf-reactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fpdf-reactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcorral","download_url":"https://codeload.github.com/tcorral/pdf-reactor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241955038,"owners_count":20048405,"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":[],"created_at":"2024-11-15T05:39:45.779Z","updated_at":"2026-03-06T09:04:08.834Z","avatar_url":"https://github.com/tcorral.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"PDF Reactor\n===========\n\nThis an express server that will generate PDF from a provided url based on wkhtmltopdf.\nIt also use S3 to cache on request the pdf that won't change (like: invoices, ...)\n\n## Install\n\nFirst install **wkhtmltohtml** for your system from here :  [http://wkhtmltopdf.org/downloads.html](http://wkhtmltopdf.org/downloads.html)\n\n**Note:** The Mac OSX version is buggy and will some time create image based pdfs instead of text based. Better to install it on a Linux.\n\nThen simply clone the repository:   \n\n`git clone https://github.com/Woorank/pdf-reactor.git`\n\n## Configuration\n\nYou can configure the server on the config/[your environement].json file.\nHere is a sample :\n\n```json\n{\n  \"loglevel\": \"info\",\n  \"port\": 3000,\n  \"aws\": {\n    \"accessKeyId\": \"\u003cYOUR_ACCESS_KEY\u003e\",\n    \"secretAccessKey\": \"\u003cYOUR_SECRET_ACCESS_KEY\u003e\",\n    \"region\": \"us-east-1\"\n  },\n  \"s3\": {\n    \"bucket\": \"\u003cYOUR_DEDICATED_S3_BUCKET_NAME\u003e\"\n  }\n}\n```\n\n## Npm commands\n\nThe package.json have several commands setup\n\n- To start the service just do: `NODE_ENV=\u003cYOUR_ENV\u003e npm start`\n- If you have nodemon installed, you can run: `NODE_ENV=\u003cYOUR_ENV\u003e npm run nodemon`\n- To test synthax and mocha tests (not any for now), run: `npm test`\n- To check only the synthax, just run: `npm run lint`\n- To run only the tests (not any for now), you can run: `npm run mocha`\n\nSome more command are ready for Travis and Coverall, check the package.json\n\n## Routes\n\n**GET** /\n\nWill return the name and the version of the service.\n\n**GET** /healthcheck\n\nThis url is primarly there for Elastic Load-Balancer AWS.\n\n\n**GET** /pdf?url=`http://www.google.com`\n\nTries to guess the facebook brand page and returns all its details\n\n\nParameters     | Description\n--------------:| ---------------------------\nurl            | \u003cstring\u003e The url of the page you want to convert in pdf\nheader         | (optional) \u003cstring\u003e The url that provides the html for the header\nfooter         | (optional) \u003cstring\u003e The url that provides the html for the footer\nlandscape      | (optional) \u003cboolean\u003e Change the orientation from portrait to landscape\nfromCache      | (optional) \u003cboolean\u003e Will try first to get the pdf from S3, if it doesn't exists it'll add it on S3 while sending it.\nrefreshCache   | (optional) \u003cboolean\u003e Will refresh or create the pdf on S3 while sending it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Fpdf-reactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcorral%2Fpdf-reactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Fpdf-reactor/lists"}