{"id":13464964,"url":"https://github.com/astefanutti/decktape","last_synced_at":"2025-05-13T16:06:33.727Z","repository":{"id":31666622,"uuid":"35232064","full_name":"astefanutti/decktape","owner":"astefanutti","description":"PDF exporter for HTML presentations","archived":false,"fork":false,"pushed_at":"2025-04-15T15:25:48.000Z","size":30215,"stargazers_count":2250,"open_issues_count":43,"forks_count":180,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-16T05:48:15.092Z","etag":null,"topics":["converter","exporter","html","pdf","presentations","slides"],"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/astefanutti.png","metadata":{"files":{"readme":"README.adoc","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":"2015-05-07T16:50:51.000Z","updated_at":"2025-04-15T22:52:05.000Z","dependencies_parsed_at":"2023-12-23T16:36:14.181Z","dependency_job_id":"8375bf3a-2105-4507-bf15-c7aff8f82efe","html_url":"https://github.com/astefanutti/decktape","commit_stats":{"total_commits":463,"total_committers":37,"mean_commits":"12.513513513513514","dds":0.2311015118790497,"last_synced_commit":"5f1ee8822bdfd69ff3633df87821f1a62aec77db"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astefanutti%2Fdecktape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astefanutti%2Fdecktape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astefanutti%2Fdecktape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astefanutti%2Fdecktape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astefanutti","download_url":"https://codeload.github.com/astefanutti/decktape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250513283,"owners_count":21443192,"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":["converter","exporter","html","pdf","presentations","slides"],"created_at":"2024-07-31T14:00:53.607Z","updated_at":"2025-04-23T20:41:47.192Z","avatar_url":"https://github.com/astefanutti.png","language":"JavaScript","readme":"= DeckTape\nAntonin Stefanutti \u003chttps://github.com/astefanutti[@astefanutti]\u003e\n// Meta\n:description: DeckTape is a high-quality PDF exporter for HTML presentation frameworks.\n:decktape-version: 3.0.0\n// Settings\n:idprefix:\n:idseparator: -\n// Aliases\n:bullet: \u0026#8201;\u0026#8226;\u0026#8201;\nifdef::env-github[]\n:note-caption: :information_source:\n:icon-ban: :no_entry_sign:\n:icon-check: :white_check_mark:\n:icon-clock: :clock10:\n:icon-exclamation: :exclamation:\n:icon-exclamation-dim: :grey_exclamation:\n:icon-edit: :pencil2:\nendif::[]\nifndef::env-github[]\n:icons: font\n:icon-ban: icon:ban[fw,role=red]\n:icon-check: icon:check-square-o[fw,role=green]\n:icon-clock: icon:clock-o[fw,role=silver]\n:icon-exclamation: icon:exclamation[fw,role=red]\n:icon-exclamation-dim: icon:exclamation[fw,role=silver]\n:icon-edit: icon:pencil[fw]\nendif::[]\n// URIs\n:uri-badge-npm: https://img.shields.io/npm/v/decktape.svg\n:uri-badge-node: https://img.shields.io/node/v/decktape.svg\n:uri-decktape-npm: https://www.npmjs.com/package/decktape\n:uri-decktape-release: https://github.com/astefanutti/decktape/releases/latest\n\n:uri-puppeteer: https://github.com/GoogleChrome/puppeteer\n:uri-w3c-uievents-key: https://www.w3.org/TR/uievents-key/\n\n:uri-docker-image: https://github.com/astefanutti/decktape/pkgs/container/decktape\n:uri-docker-ref: http://docs.docker.com/engine/reference\n\n:uri-bespokejs: http://markdalgleish.com/projects/bespoke.js\n:uri-deckjs: http://imakewebthings.com/deck.js\n:uri-dzslides: http://paulrouget.com/dzslides\n:uri-flowtimejs: https://marcolago.github.io/flowtime.js/\n:uri-impressjs: https://impress.js.org\n:uri-inspire: https://inspirejs.org\n:uri-nuedeck: https://github.com/twitwi/nuedeck\n:uri-pageres: https://github.com/sindresorhus/pageres\n:uri-remark: https://remarkjs.com\n:uri-revealjs: https://revealjs.com\n:uri-rise: https://github.com/damianavila/RISE\n:uri-shower: https://shwr.me\n:uri-slidy: https://www.w3.org/Talks/Tools/Slidy/\n:uri-webslides: https://github.com/jlantunez/webslides\n\nimage:{uri-badge-npm}[link=\"{uri-decktape-npm}\"] image:{uri-badge-node}[]\n\n{description}\n\nDeckTape is built on top of {uri-puppeteer}[Puppeteer] which relies on Google Chrome for laying out and rendering Web pages and provides a headless Chrome instance scriptable with a JavaScript API.\n\nDeckTape currently supports the following presentation frameworks out of the box:\n\n{uri-bespokejs}[Bespoke.js]{bullet}\n{uri-deckjs}[deck.js]{bullet}\n{uri-dzslides}[DZSlides]{bullet}\n{uri-flowtimejs}[Flowtime.js]{bullet}\n{uri-impressjs}[impress.js]{bullet}\n{uri-inspire}[Inspire.js]{bullet}\n{uri-nuedeck}[NueDeck]{bullet}\n{uri-remark}[remark]{bullet}\n{uri-revealjs}[reveal.js]{bullet}\n{uri-rise}[RISE]{bullet}\n{uri-shower}[Shower]{bullet}\n{uri-slidy}[Slidy]{bullet}\n{uri-webslides}[WebSlides]\n\nDeckTape also provides a \u003c\u003cgeneric,generic command\u003e\u003e that works by emulating the end-user interaction, allowing it to be used to convert presentations from virtually any kind of framework.\nThe generic mode is particularly useful for supporting HTML presentation frameworks that don't expose an API or accessible state.\n\nDeckTape's plugin-based architecture exposes an extension API, making it possible to add support for other frameworks or to tailor existing plugins to your specific needs.\n\nDeckTape can optionally be used to capture screenshots of your slide decks in various resolutions (similar to {uri-pageres}[pageres]).\nThat can be useful to make sure your presentations are responsive or to create handouts for them.\n\nYou can browse some slide deck \u003c\u003cexamples,examples\u003e\u003e below that have been exported with DeckTape.\n\n== Install\n\n=== NPM\n\nInstall DeckTape globally and run it:\n\n```sh\n$ npm install -g decktape\n$ decktape\n```\n\nOr locally:\n\n```sh\n$ npm install decktape\n$ `npm bin`/decktape\n```\n\nSee the \u003c\u003cfaq,FAQ\u003e\u003e for troubleshooting / alternatives.\n\n== Usage\n\n[source]\n----\n$ decktape -h\n\nUsage: decktape [options] [command] \u003curl\u003e \u003cfilename\u003e\n       decktape version\n\ncommand      one of: automatic, bespoke, deck, dzslides, flowtime, generic, impress, inspire,\n             nuedeck, remark, reveal, shower, slidy, webslides\nurl          URL of the slides deck\nfilename     Filename of the output PDF file\n\nOptions:\n   -s \u003csize\u003e, --size \u003csize\u003e        Size of the slides deck viewport: \u003cwidth\u003ex\u003cheight\u003e (e.g. '1280x720')\n   -p \u003cms\u003e, --pause \u003cms\u003e           Duration in milliseconds before each slide is exported  [1000]\n   --load-pause \u003cms\u003e               Duration in milliseconds between the page has loaded and starting to export slides  [0]\n   --url-load-timeout \u003cms\u003e         Timeout in milliseconds to use when waiting for the initial URL to load  [60000]\n   --page-load-timeout \u003cms\u003e        Timeout in milliseconds to use when waiting for the slide deck page to load  [20000]\n   --buffer-timeout \u003cms\u003e           Timeout in milliseconds to use when waiting for a slide to finish buffering (set to 0 to disable)  [30000]\n   --screenshots                   Capture each slide as an image  [false]\n   --screenshots-directory \u003cdir\u003e   Screenshots output directory  [screenshots]\n   --screenshots-size \u003csize\u003e       Screenshots resolution, can be repeated\n   --screenshots-format \u003cformat\u003e   Screenshots image format, one of [jpg, png]  [png]\n   --slides \u003crange\u003e                Range of slides to be exported, a combination of slide indexes and ranges (e.g. '1-3,5,8')\n   --headless                      Puppeteer headless mode, one if [new, true, false]  [new]\n   --headers                       HTTP headers, comma-separated list of \u003cheader\u003e,\u003cvalue\u003e pairs (e.g. \"Authorization,'Bearer ASDJASLKJALKSJDL'\")\n   --chrome-path \u003cpath\u003e            Path to the Chromium or Chrome executable to run instead of the bundled Chromium\n   --chrome-arg \u003carg\u003e              Additional argument to pass to the Chrome instance, can be repeated\n   --pdf-author \u003carg\u003e              String to set as the author of the resulting PDF document\n   --pdf-title \u003carg\u003e               String to set as the title of the resulting PDF document\n   --pdf-subject \u003carg\u003e             String to set as the subject of the resulting PDF document\n\nDefaults to the automatic command.\nIterates over the available plugins, picks the compatible one for presentation at the\nspecified \u003curl\u003e and uses it to export and write the PDF into the specified \u003cfilename\u003e.\n----\n\nIn addition to the general options listed above, command specific options can be displayed the following way:\n\n $ decktape \u003ccommand\u003e -h\n\n== Commands\n\n[#automatic]\n=== `automatic`\n\nIterates over the available link:plugins[], picks the compatible one for presentation at the specified `url` and uses it to export and write the PDF into the specified `filename`.\n\n[#generic]\n=== `generic`\n\nEmulates the end-user interaction by pressing the key with the specified `--key` option, and iterates over the presentation as long as:\n\n[loweralpha]\n. Any change to the DOM is detected by observing mutation events targeting the body element and its subtree,\n. Nor the number of slides exported has reached the specified `--max-slides` option.\n\nThe `--key` option must be a list of {uri-w3c-uievents-key}[UI events `KeyboardEvent` key values], and defaults to `['ArrowRight']`, e.g.:\n\n $ decktape generic --key=ArrowDown --key=ArrowRight\n\n== Options\n\n=== `--screenshots`\n\nCaptures each slide as an image at the `--screenshots-size` resolution, exports it to the `--screenshots-format` image format and writes the output into the `--screenshots-directory` directory.\n\nThe `--screenshots-size` option can be set multiple times. For example:\n\n $ decktape --screenshots --screenshots-size=400x300 --screenshots-size=800x600\n\n=== `--slides`\n\nExports only the slides specified as a series of slides indexes and ranges, e.g.:\n\n[source,shell]\n----\n# Capture a single slide\n$ decktape --slides 1\n# Capture a series of slides\n$ decktape --slides 1,3,5\n# Capture a range of slides\n$ decktape --slides 1-10\n# Capture a combination of slides and ranges\n$ decktape --slides 1,2,5-10\n----\n\nThe rendering stops and the file written out after the largest numbered slide is exported.\n\n== Examples\n\nThe following slide deck examples have been exported using DeckTape:\n\n[cols=\"1v,1v,1v\"]\n|===\n|HTML5 Presentation |Framework |Exported PDF\n\n|https://revealjs.com/demo/[Reveal.js Demo]\n|reveal.js\n|https://astefanutti.github.io/decktape/examples/reveal-js-demo.pdf[reveal-js-demo.pdf] (2.0MB)\n\n|https://tdd.github.io/devoxx-es6-maintenant/[ES6+ maintenant !]\n|reveal.js\n|https://astefanutti.github.io/decktape/examples/devoxx-es6-maintenant.pdf[devoxx-es6-maintenant.pdf] (2.3MB)\n\n|https://github.com/hakimel/reveal.js/blob/360bc940062711db9b8020ce4e848f6c37014481/test/examples/math.html[reveal.js MathJax example]\n|reveal.js\n|https://astefanutti.github.io/decktape/examples/reveal-js-mathjax.pdf[reveal-js-mathjax.pdf] (0.3MB)\n\n|https://artificer.jboss.org/slides/general/opensource-getting-involved.html[Getting Involved in Open Source]\n|reveal.js\n|https://astefanutti.github.io/decktape/examples/opensource-getting-involved.pdf[opensource-getting-involved.pdf] (0.6MB)\n\n|http://astefanutti.github.io/further-cdi[Going Further with CDI]\n|Asciidoctor + DZSlides\n|https://astefanutti.github.io/decktape/examples/going-further-with-cdi.pdf[going-further-with-cdi.pdf] (2.4MB)\n\n|http://imakewebthings.com/deck.js[Deck.js Modern HTML Presentations]\n|deck.js\n|https://astefanutti.github.io/decktape/examples/deck-js-presentation.pdf[deck-js-presentation.pdf] (0.5MB)\n\n|https://remarkjs.com[The Official Remark Slideshow]\n|remark\n|https://astefanutti.github.io/decktape/examples/remark-js-slideshow.pdf[remark-js-slideshow.pdf] (0.15MB)\n\n|https://joshbode.github.io/remark/ansi.html[Coloured Terminal Listings in Remark]\n|remark\n|https://astefanutti.github.io/decktape/examples/remark-js-coloured-terminal.pdf[remark-js-coloured-terminal.pdf] (0.12MB)\n\n|https://www.w3.org/Talks/Tools/Slidy[HTML Slidy: Slide Shows in HTML and XHTML]\n|Slidy\n|https://astefanutti.github.io/decktape/examples/html-slidy-presentation.pdf[html-slidy-presentation.pdf] (0.5MB)\n\n|https://inspirejs.org[Inspire.js: Lean, hackable, extensible slide deck framework]\n|Inspire.js\n|https://astefanutti.github.io/decktape/examples/inspirejs-sample-slideshow.pdf[inspirejs-sample-slideshow.pdf] (1.9MB)\n\n|https://shwr.me[Shower Presentation Engine]\n|Shower\n|https://astefanutti.github.io/decktape/examples/shower-presentation-engine.pdf[shower-presentation-engine.pdf] (0.6MB)\n\n|http://mikemaccana.github.io/rejectjs2013[Welcome our new ES5 Overloards]\n|Bespoke.js\n|https://astefanutti.github.io/decktape/examples/new-es5-overloards.pdf[new-es5-overloards.pdf] (0.2MB)\n\n|https://formidable.com/open-source/spectacle/[Spectacle: A ReactJS Presentation Library]\n|Spectacle\n|https://astefanutti.github.io/decktape/examples/spectacle-reactjs-presentation.pdf[spectacle-reactjs-presentation.pdf] (1.2MB)\n|===\n\n== Docker\n\nDeckTape can be executed in a container from the command-line using the {uri-docker-image}[`ghcr.io/astefanutti/decktape`] container image:\n\n $ docker run ghcr.io/astefanutti/decktape -h\n\nFor example:\n\n* To convert an online HTML presentation and have it exported into the working directory under the `slides.pdf` filename:\n[source,shell,subs=attributes+]\n$ docker run --rm -t -v `pwd`:/slides ghcr.io/astefanutti/decktape https://revealjs.com/demo/ slides.pdf\n\n* Or, to convert an HTML presentation that's stored on the local file system in the `home` directory:\n[source,shell]\n$ docker run --rm -t -v `pwd`:/slides -v ~:/home/user ghcr.io/astefanutti/decktape /home/user/slides.html slides.pdf\n\n* Or, to convert an HTML presentation that's deployed on the local host:\n[source,shell]\n$ docker run --rm -t --net=host -v `pwd`:/slides ghcr.io/astefanutti/decktape http://localhost:8000 slides.pdf\n+\nYou may have to use `host.docker.internal` instead of `localhost` on macOS and Windows.\n\nYou may want to specify a tag corresponding to a released version of DeckTape for the container image, e.g. `ghcr.io/astefanutti/decktape:{decktape-version}`.\n\nBesides, it is recommended to use the following options from the {uri-docker-ref}/run[`docker run`] command:\n\n{uri-docker-ref}/run/#clean-up-rm[`--rm`]:: DeckTape is meant to be run as a short-term foreground process so that it's not necessary to have the container's file system persisted after DeckTape exits,\n{uri-docker-ref}/commandline/run/#mount-volume-v-read-only[`-v`]:: to mount a data volume so that DeckTape can directly write to the local file system.\n\nAlternatively, you can use the {uri-docker-ref}/commandline/cp[`docker cp`] command, e.g.:\n\n[source,shell]\n----\n# Run docker run without the --rm option\n$ docker run ghcr.io/astefanutti/decktape https://revealjs.com/demo/ slides.pdf\n# Copy the exported PDF from the latest used container to the local file system\n$ docker cp `docker ps -lq`:slides/slides.pdf .\n# Finally remove the latest used container\n$ docker rm `docker ps -lq`\n----\n\nIf your presentation relies on fonts installed on the host system, but not in the container image, you can mount your fonts directory as a volume, e.g. for macOS:\n\n[source,shell]\n$ docker run -v \"${HOME}/Library/Fonts:/home/node/.local/share/fonts\" ...\n\n== FAQ\n\n=== Install\n\n* *_I'm using Arch Linux, is there an AUR package?_*\n+\nYes, it is available at https://aur.archlinux.org/packages/nodejs-decktape/.\n\n=== Usage\n\n* *_Is it possible to pass arguments to Chrome?_*\n+\nYes, you can use the `--chrome-arg` option, e.g.:\n+\n[source,shell]\n----\n$ decktape ... \\\n  --chrome-arg=--proxy-server=\"proxy:8080\" \\\n  --chrome-arg=--allow-file-access-from-files\n----\n+\nThe list of Chromium flags can be found https://peter.sh/experiments/chromium-command-line-switches/[here].\n\n=== Troubleshooting\n\n* *_No usable sandbox!_*\n+\nArch Linux, among other Linux distributions may have the user namespace in the kernel disabled by default. You can verify this by accessing _chrome://sandbox_ in your Chrome browser.\nYou can find more about sandboxing, https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandboxing.md#User-namespaces-sandbox[here].\nAs a _temporary_ work-around, you can pass `--chrome-arg=--no-sandbox` as a CLI option.\n\n* *_Mixed Content: The page was loaded over HTTPS, but requested an insecure resource_*\n+\nChrome blocks insecure content on secure pages by default.\nThis can be alleviated by passing the `--allow-running-insecure-content` flag option, e.g.:\n+\n[source,shell]\n----\n$ decktape ... --chrome-arg=--allow-running-insecure-content\n----\n\n* *_Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules_*\n+\nStarting Chrome 64, accessing CSS rules in a stylesheet loaded from the local filesystem or an external location violates CORS policies.\nAs some Decktape plugins tweak the CSS rules for better PDF printing, you need to allow access to local files or external stylesheets by setting the `--disable-web-security` flag option, e.g.:\n+\n[source,shell]\n----\n$ decktape ... --chrome-arg=--disable-web-security\n----\n\n* *_Layout inconsistencies_*\n+\nDecktape relies on Pupeteer to convert each slide in PDF format. Slight layout inconsistencies can result as part of this transformation.\nOne workaround is to set a specific slide size using the `-s` option.\nThe value of `-s 1024x768` has generally worked well in such situations.\n\n* *_Reveal.js slide generation never finishes_*\n+\nDecktape does not use the built-in PDF support of reveal.js, and instead captures each slide individually.\nTherefore you must not append `?print-pdf` or load the print stylesheets in any other way when using Decktape.\n\n== Plugin API\n\n{icon-edit}\n","funding_links":[],"categories":["JavaScript","Productivity","HarmonyOS","JAVASCRIPT","PDF Export","Tools for creating slides","\u003ca name=\"office\"\u003e\u003c/a\u003eOffice tools","Rendering and web scraping"],"sub_categories":["Presentations","Windows Manager","postMessage API","Videos"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastefanutti%2Fdecktape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastefanutti%2Fdecktape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastefanutti%2Fdecktape/lists"}