{"id":21189210,"url":"https://github.com/uptick/splat","last_synced_at":"2026-03-15T22:47:16.730Z","repository":{"id":39605482,"uuid":"221121989","full_name":"uptick/splat","owner":"uptick","description":"Serverless PrinceXML on Lambda Any Time","archived":false,"fork":false,"pushed_at":"2026-03-10T20:41:56.000Z","size":232,"stargazers_count":7,"open_issues_count":11,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-03-11T01:50:47.995Z","etag":null,"topics":["html","lambda","pdf-generation","princexml","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","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/uptick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-12T03:28:41.000Z","updated_at":"2026-02-24T02:40:49.000Z","dependencies_parsed_at":"2023-12-14T00:25:21.704Z","dependency_job_id":"3ee59bb7-a0a8-4e61-8f70-1997ec1b4b8a","html_url":"https://github.com/uptick/splat","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/uptick/splat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fsplat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fsplat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fsplat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fsplat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uptick","download_url":"https://codeload.github.com/uptick/splat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fsplat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30553563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T15:03:43.933Z","status":"ssl_error","status_checked_at":"2026-03-15T15:03:37.630Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["html","lambda","pdf-generation","princexml","serverless"],"created_at":"2024-11-20T18:50:36.077Z","updated_at":"2026-03-15T22:47:16.725Z","avatar_url":"https://github.com/uptick.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# splat\n\nsplat is simple aws lambda function that takes HTML/CSS/JS, invokes PrinceXML to render it and returns the resulting PDF in one of many ways.\n\nIt is intended to be a DIY docraptor of sorts.\n\n## Installation\n\nSimply build the docker image, deploy it to AWS, then invoke the lambda with an event body JSON that performs the desired operation. For example: `{\"document_content\": \"\u003ch1\u003eHello, World!\u003c/h1\u003e\"}`\n\nThis can be done via a function_url, apigateway or lambda invoke.\n\n## Invoking splat\n\nEvent payload body.\n\n| Field                      | Type                        | Description                                                                                                                                                                         |\n|----------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **javascript (princexml)** | boolean (False)             | Enables [princeXML's javascript execution](https://www.princexml.com/doc/javascript/). This will not render react but can be used for formatting.                                   |\n| **check_license**          | boolean (False)             | Send this field to receive a check on remaining license usage                                                                                                                       |\n| **document_content**       | string                      | Embed the html content in the payload. There will be AWS payload size limitations.                                                                                                  |\n| **document_url**           | url                         | Fetch the html content from `document_url` to disk before rendering.                                                                                                                |\n| **browser_url**            | url                         | Browser the `browser_url` with `playwright` before rendering with `renderer`                                                                                                        |\n| **browser_headers**        | Mapping[str,str]            | Add additional headers to playwright before visiting `browser_url`                                                                                                                  |\n| **browser_pdf_options**    | Mapping[str,str]            | Add additional options to playwright `.pdf()` call                                                                                                                                  |                                                                                                                                                                           |\n| **renderer**               | `princexml` or `playwright` | Renderer to render the html with                                                                                                                                                    |\n| **bucket_name**            | string                      | Output the resulting pdf to `s3://{bucket_name}/{uuid}.pdf`. The lambda will require permission to upload to the bucket. The response will include `bucket`, `key`, `presigned_url` |\n| **presigned_url**          | url                         | Output the resulting pdf to the presigned url. Generate the presigned url with `put_object`. See Output for more information.                                                       |\n\n### Input\n\nPass content in event: `{\"document_content\": \"\u003ch1\u003eHello, World!\u003c/h1\u003e\"}`\n\nPass content via URL: `{\"document_url\": \"https://some_page/report.html\"}`\n\nPass content via Browser page: `{\"browser_url\": \"https://some_react_page/\", \"renderer\": \"princexml\", \"browser_headers\": {\"Authorization\": \"Bearer SOME_BEARER_TOKEN\"}}`\n\n### Output\n\nReturns PDF base64 encoded by default.\n\nTo save to an s3 bucket (lambda requires permission): `{\"bucket_name\": \"\u003cBUCKET\u003e\"}`\n\nTo save to a presigned url: `{\"presigned_url\": \"\u003cURL\u003e\"}`\n\n## PrinceXML License\n\nsplat will attempt to install a PrinceXML license file by default. Just drop your `license.dat` in the root directory before you build the docker container. The licence file is gitignored for your convenience.\nIf you do not have a licence file, Prince will watermark your PDFs, and you can only use them non-commercially. See their [license page](https://www.princexml.com/purchase/license_faq/) for more information.\n\nYou can check the status of the licence by invoking the lambda with the `{\"check_license\": true}` option, and interpreting the response, you can use this to periodically check the status of the licence and raise an alert if it's about to expire, and to verify that your new licence has updated correctly.\n\n## Fonts\n\nsplat will add any fonts inside a `fonts.zip` file. Ensure the zip file contains a folder called `fonts` with all fonts inside. Simply drop into the root directory and build the docker container. The `fonts.zip` file is gitignored for your convenience. By default, prince comes with a small suite of liberation fonts.\n\n## Library\n\nSplat can be used via the `uptick_splat` library. Install with `pip install uptick_splat`.\n\nUsage:\n\n```python\nfrom uptick_splat import configure_splat, pdf_with_splat\n\n\nconfigure_splat(\n    function_region=\"ap-southeast-2\",\n    function_name=\"splat\",\n    default_bucket_name=\"your-bucket-to-upload-html-to\",\n)\n\nsome_html = \"\u003ch1\u003etest\u003c/h1\u003e\"\n\npdf_with_splat(some_html, bucket_name=\"test_bucket\")\n# or\npdf_with_splat(some_html)\n```\n\n# Development\n\nInstall [mise](https://mise.jdx.dev/getting-started.html) task runner.\n\n\n```\nmise run install # booststrap the project and install requirements\n\nmise run test # run tests\n\nmise run format # format\n```\n\n## Local testing\n\nUse the `./splat_cli.py` program (via UV) to execute the lambda.\nIt is possible to target the lambda running in the docker container or a deployed lambda running in aws.\n\nExample usages:\n\n```bash\n# Invoke using a local function url\n./splat_cli.py -o /tmp/google.pdf -b https://google.com\n\n# Invoke using a deployed AWS lambda against an embedded document content\n./splat_cli.py -o /tmp/test.pdf -c \"\u003ch1\u003e hi \u003c/h1\u003e\" --function-name splat-staging\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptick%2Fsplat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuptick%2Fsplat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptick%2Fsplat/lists"}