{"id":15025172,"url":"https://github.com/jasonday/printthis","last_synced_at":"2025-05-14T18:05:39.468Z","repository":{"id":39121172,"uuid":"6493360","full_name":"jasonday/printThis","owner":"jasonday","description":"jQuery printing plugin; print specific elements on a page","archived":false,"fork":false,"pushed_at":"2023-05-20T15:27:40.000Z","size":622,"stargazers_count":1060,"open_issues_count":19,"forks_count":452,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-05-08T18:06:21.532Z","etag":null,"topics":["jquery","jquery-plugin","print","printing"],"latest_commit_sha":null,"homepage":"https://jasonday.github.io/printThis/","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/jasonday.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["jasonday"],"open_collective":"jason-day"}},"created_at":"2012-11-01T17:03:06.000Z","updated_at":"2025-04-15T10:52:26.000Z","dependencies_parsed_at":"2023-09-29T08:52:32.670Z","dependency_job_id":null,"html_url":"https://github.com/jasonday/printThis","commit_stats":{"total_commits":175,"total_committers":26,"mean_commits":6.730769230769231,"dds":"0.48571428571428577","last_synced_commit":"23be1f8ad7ab3b3526c43dc47775279edd65bd85"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonday%2FprintThis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonday%2FprintThis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonday%2FprintThis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonday%2FprintThis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonday","download_url":"https://codeload.github.com/jasonday/printThis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"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":["jquery","jquery-plugin","print","printing"],"created_at":"2024-09-24T20:01:39.509Z","updated_at":"2025-05-14T18:05:39.417Z","avatar_url":"https://github.com/jasonday.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jasonday","https://opencollective.com/jason-day","https://opencollective.com/printThis","https://opencollective.com/printThis/contribute","https://opencollective.com/printThis/organization/0/website","https://opencollective.com/printThis/organization/1/website","https://opencollective.com/printThis/organization/2/website","https://opencollective.com/printThis/organization/3/website","https://opencollective.com/printThis/organization/4/website","https://opencollective.com/printThis/organization/5/website","https://opencollective.com/printThis/organization/6/website","https://opencollective.com/printThis/organization/7/website","https://opencollective.com/printThis/organization/8/website","https://opencollective.com/printThis/organization/9/website"],"categories":[],"sub_categories":[],"readme":"\n\u003ca href=\"https://badge.fury.io/js/print-this\"\u003e\u003ca href=\"https://opencollective.com/printThis\" \u003e\u003cimg src=\"https://opencollective.com/printThis/all/badge.svg?label=financial+contributors\" alt=\"Financial Contributors on Open Collective\"/\u003e\u003c/a\u003e \u003cimg src=\"https://badge.fury.io/js/print-this.svg\" alt=\"npm version\" height=\"18\" align=\"right\"\u003e\u003c/a\u003e\n\n# printThis\nPrinting plug-in for jQuery\n#### [Try the Demo](https://jasonday.github.io/printThis/)\n\n\n## Features\n* Print specific \u0026 multiple DOM elements\n* Preserve page CSS/styling\n** or add new CSS; the world is your oyster!\n* Preserve form entries\n* Canvas support\n\n\n## Usage\n### Basic\n```javascript\n$('selector').printThis();\n```\n\n### Advanced Features\n```javascript\n$('#kitty-one, #kitty-two, #kitty-three').printThis({\n    importCSS: false,\n    loadCSS: \"\",\n    header: \"\u003ch1\u003eLook at all of my kitties!\u003c/h1\u003e\"\n});\n```\n\n### Troubleshooting\n[Check the printThis wiki for common issues and questions](https://github.com/jasonday/printThis/wiki)\n\n*Covers common issues related to styling and printing limitations regarding page breaks*\n\n\n### Options\nNow with TypeScript definitions.\n\n#### debug\nDebug leaves the iframe visible on the page after `printThis` runs, allowing you to inspect the markup and CSS.\n\n#### importCSS\nCopy CSS `\u003clink\u003e` tags to the printThis iframe. On by default.\n\n#### importStyle\nCopy CSS `\u003cstyle\u003e` tags to the printThis iframe. On by default.\n\n#### printContainer\nIncludes the markup of the selected container, not just its contents. On by default.\n\n#### loadCSS\nProvide a URL for an additional stylesheet to the printThis iframe. Empty string (off) by default.\n\n#### pageTitle\nUse a custom page title on the iframe. This may be reflected on the printed page, depending on settings. Blank by default.\n\n#### removeInline\nEliminates any inline style attributes from the content. Off by default.\n\n#### removeInlineSelector\nFilter which inline style attributes to remove. Requires `removeInline` to be true.\nAccepts custom CSS/jQuery selectors. Default is `\"*\"`\n\n#### printDelay\nThe amount of time to wait before calling `print()` in the printThis iframe. Defaults to 1000 milliseconds.\nAppropriate values depend heavily on the content and network performance. Graphics heavy, slow, or uncached content may need extra time to load.\n\n#### header \u0026 footer\nA string or jQuery object to prepend or append to the printThis iframe content. `null` by default.\n\n```javascript\n$('#mySelector').printThis({\n    header: \"\u003ch1\u003eAmazing header\u003c/h1\u003e\"\n});\n\n$('#mySelector').printThis({\n    footer: $('.hidden-print-header-content')\n});\n```\n\njQuery objects are cloned rather than moved.\n\n#### base\nThe `base` option allows several behaviors.\nBy default it is `false`, meaning a the current document will be set as the base URL.  \n\nIf set to `true`, a `\u003cbase\u003e` attribute will be set if one exists on the page.\nIf none is found, the tag is omitted, which may be suitable for pages with Fully Qualified URLs.\n\nWhen passed as a string, it will be used as the `href` attribute of a `\u003cbase\u003e` tag.\n\n#### formValues\nThis setting copies the current values of form elements into the printThis iframe. On by default.\n\n#### canvas\nCanvas elements will be copied to the printThis iframe \nand you can call printThis directly on a canvas element if you choose.\n\n#### doctypeString\nA doctype string to use on the printThis iframe. Defaults to the HTML5 doctype.\n\n#### removeScripts\nDeletes script tags from the content to avoid errors or unexpected behavior during print. Disabled by default.\n\n#### copyTagClasses: true\nCopies classes from the body and html tags into the printThis iframe.  \nAccepts `true`, `\"b\"`, `\"h\"`, or `\"bh\"` to test for `\"b\"` and `\"h\"` for body and html tags, respectively.\n\n#### copyTagStyles: true\nCopies style attributes from the body and html tags into the printThis iframe.\nAdded to provide support for CSS Variables.\nAccepts `true`, `\"b\"`, `\"h\"`, or `\"bh\"` to test for `\"b\"` and `\"h\"` for body and html tags, respectively.  \n\n#### beforePrintEvent: null\nFunction to run inside the iframe before the print occurs.  \n*This function has not been validated on all browsers.*\n\n#### beforePrint: null\nFunction called before the iframe is populated with content.\n\n#### afterPrint: null\nFunction called after the print and before the iframe is removed from the page.  \nThis is called even if `debug: true`, which does not remove the iframe.\n\n### All Options\n```javascript\n$(\"#mySelector\").printThis({\n    debug: false,               // show the iframe for debugging\n    importCSS: true,            // import parent page css\n    importStyle: true,          // import style tags\n    printContainer: true,       // print outer container/$.selector\n    loadCSS: \"\",                // path to additional css file - use an array [] for multiple\n    pageTitle: \"\",              // add title to print page\n    removeInline: false,        // remove inline styles from print elements\n    removeInlineSelector: \"*\",  // custom selectors to filter inline styles. removeInline must be true\n    printDelay: 1000,           // variable print delay\n    header: null,               // prefix to html\n    footer: null,               // postfix to html\n    base: false,                // preserve the BASE tag or accept a string for the URL\n    formValues: true,           // preserve input/form values\n    canvas: false,              // copy canvas content\n    doctypeString: '...',       // enter a different doctype for older markup\n    removeScripts: false,       // remove script tags from print content\n    copyTagClasses: true,       // copy classes from the html \u0026 body tag\n    copyTagStyles: true,        // copy styles from html \u0026 body tag (for CSS Variables)\n    beforePrintEvent: null,     // function for printEvent in iframe\n    beforePrint: null,          // function called before iframe is filled\n    afterPrint: null            // function called before iframe is removed\n});\n```\n\n## Please read\n* \"It's not working\" without any details is not a valid issue and will be closed\n* A url, or html file, is necessary to debug. Due to the complexities of printing and this plugin, an example is the best way to debug\n* When troubleshooting, set `debug: true` and inspect the iframe. Please report your findings when reporting an issue\n* Every user should be active in the debugging process\n\n## ToDo:\n* Look at alternative to setTimeout ($.deferred?)\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/jasonday/printThis/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/printThis/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/printThis/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/printThis\"\u003e\u003cimg src=\"https://opencollective.com/printThis/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/printThis/contribute)]\n\n\u003ca href=\"https://opencollective.com/printThis/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/printThis/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/printThis/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonday%2Fprintthis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonday%2Fprintthis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonday%2Fprintthis/lists"}