{"maintainers":[{"name":"anonymous","email":"katzer@appplant.de"}],"keywords":["appplant","printer","cordova","ecosystem:cordova","cordova-ios","cordova-android","cordova-windows","cordova-browser"],"dist-tags":{"latest":"0.8.0"},"author":{"name":"Sebastián Katzer"},"description":"Prints HTML documents","readme":"\n<p align=\"left\">\n    <b><a href=\"https://github.com/katzer/cordova-plugin-printer/blob/example/README.md\">SAMPLE APP</a> :point_right:</b>\n</p>\n\n# Cordova Print Plugin <br> [![npm version](https://badge.fury.io/js/cordova-plugin-printer.svg)](http://badge.fury.io/js/cordova-plugin-printer) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![PayPayl donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=L3HKQCD9UA35A \"Donate once-off to this project using Paypal\")\n\nPlugin for [Cordova][cordova] to print documents, photos, HTML and plain text from iOS, Android and Windows Universal apps.\n\n```js\ncordova.plugins.printer.print('<b>Hello Cordova!</b>');\n```\n\n<img width=\"280px\" align=\"right\" src=\"https://github.com/katzer/cordova-plugin-printer/blob/example/images/print.png\">\n\n### Supported Printer Interfaces\n\n- Apple AirPrint\n- Android Print\n- Windows Print\n\n### Supported Content\n\n- HTML\n- Text\n- Base64\n- Images\n- PDF\n\n### Supported Platforms\n\n- Android 4.4+\n- iOS 10+\n- Windows 10 UWP\n- Browser\n\n## Basics\n\nThe plugin creates the object `cordova.plugins.printer` and is accessible after the *deviceready* event has been fired.\n\n```js\ndocument.addEventListener('deviceready', function () {\n    // cordova.plugins.printer is now available\n}, false);\n```\n\nPrints the contents of the web view:\n\n```javascript\ncordova.plugins.printer.print();\n```\n\nPlain text:\n\n```javascript\ncordova.plugins.printer.print(\"Hello\\nWorld!\");\n```\n\nHTML & CSS:\n\n```javascript\ncordova.plugins.printer.print('<h1>Hello World!</h1>');\n```\n\nImages, PDF and other documents:\n\n```javascript\ncordova.plugins.printer.print('file://img/logo.png');\n```\n\nBase64 encoded content:\n\n```javascript\ncordova.plugins.printer.print('base64://...');\n```\n\n__Note:__ On the browser platform the plugin only supports to print the contents of the web view.\n\n## Formatting\n\nIt's possible to pass format options to the print method that overrides the defaults:\n\n```javascript\ncordova.plugins.printer.print(content, options, callback);\n```\n\nThe defaults are defined as follows:\n\n```javascript\ncordova.plugins.printer.setDefaults({ monochrome: true });\n```\n\nThe list of possible options depend on the platform, the content type and the capabilities of the printer.\n\n| Name | Description | Type | Platform |\n|:---- |:----------- |:----:| --------:|\n| name | The name of the print job and of the document. | String | all |\n| copies | The number of copies for the print task. | Number | iOS<br>Windows |\n| pageCount | Limits the pages to print even the document contains more.<br>To skip the last n pages you can assign a negative value on iOS. | Number | iOS<br>Android |\n| duplex | Either double-sided on short site (duplex:'short'), double-sided on long site (duplex:'long') or single-sided (duplex:'none'). | String | all |\n| orientation | The orientation of the printed content, `portrait` or `landscape`. | String | all |\n| monochrome | If your application only prints black text, setting this property to _true_ can result in better performance in many cases. | Boolean | all |\n| photo | Set to _true_ to change the media type to photography for higher quality. | Boolean | iOS<br>Windows |\n| autoFit | Set to _false_ to disable downscaling the image to fit into the content aread. | Boolean | Android |\n| printer | The network URL to the printer. | String | iOS |\n| maxHeight<br>maxWidth | Defines the maximum size of the content area. | Unit | iOS |\n| margin.top<br>margin.left<br>margin.right<br>margin.bottom | The margins for each printed page. Each printer might have its own minimum margins depends on media type and paper format. | Unit | iOS |\n| ui.hideNumberOfCopies | Set to _true_ to hide the control for the number of copies. | Boolean | iOS |\n| ui.hidePaperFormat | Set to _true_ to hide the control for the paper format. | Boolean | iOS |\n| ui.top<br>ui.left | The position of the printer picker. | Number | iPad |\n| ui.height<br>ui.width | The size of the printer picker. | Number | iPad |\n| paper.width<br>paper.height | The dimensions of the paper – iOS will will try to choose a format which fits bests. | Unit | iOS |\n| paper.name | The name of the format like `IsoA4` or `Roll22Inch`.<br>https://docs.microsoft.com/en-us/uwp/api/windows.graphics.printing.printmediasize | String | Windows |\n| paper.length | On roll-fed printers you can decide when the printer cuts the paper. | Unit | iOS |\n| font.name | The name of the font family | String | iOS |\n| font.size | The size of the font | Number | iOS<br>Android |\n| font.italic<br>font.bold | Set to _true_ to enable these font traits. | Boolean | iOS |\n| font.align | Possible alignments are `left`, `right`, `center` and `justified`. | String | iOS |\n| font.color | The color of the font in hexa-decimal RGB format - `\"FF0000\"` means red. | String | iOS |\n| header.height<br>footer.height | The height of the header or footer on each page. | Unit | iOS |\n| header.labels<br>footer.labels | An array of labels to display. Only use if there are more then one. | Array | iOS |\n| header.label.text<br>footer.label.text | The plain text to display. Use `%ld` to indicate where to insert the page index.<br>For example `\"Page %ld\"` would result into `\"Page 1\"`, `\"Page 2\"`, ... | String | iOS |\n| header.label.top<br>header.label.right<br>header.label.left<br>header.label.bottom<br>footer.label.* | The relative position where to place the label within the footer or header area. | Unit | iOS |\n| header.label.font<br>footer.label.font | The font attributes for the label. | Object | iOS |\n| header.label.showPageIndex<br>footer.label.showPageIndex | Set to _true_ if you want to display the page index.<br> | Boolean | iOS |\n\nThe `Unit` type can be either a (float) number or a string with a special suffix.\n\n- Supported unit suffixes are `in` for inches, `mm` for millimeters, `cm` for centimeters and `pt` for points\n- `\"2in\"` are two inches whereas `2.0` or `\"2.0pt\"` are identical for two points\n- One inch are 72.0 points\n\n## Direct Print\n\nFor iOS its possible to send the content directly to the printer without any dialog. Todo so pass the network URL as an option:\n\n```javascript\ncordova.plugins.printer.print(content, { printer: 'ipp://...' });\n```\n\nTo let the user pick an available printer:\n\n```javascript\ncordova.plugins.printer.pick(function (url) {});\n```\n\nIt's possible to specify the position of the picker:\n\n```javascript\ncordova.plugins.printer.pick({ top: 40, left: 30 }, callback);\n```\n\n__Note:__ By passing an invalid URL, the application will throw an `Unable to connect to (null)` exception and possibly crash.\n\n## Printable Document Types\n\nThe list of supported document types differ between mobile platforms. As of writing, Windows UWP only supports HTML and plain text.\n\nTo get a list of all printable document types:\n\n```javascript\ncordova.plugins.printer.getPrintableTypes(callback);\n```\n\nTo check if printing is supported in general:\n\n```javascript\ncordova.plugins.printer.canPrintItem(callback);\n```\n\nOr in particular:\n\n```javascript\ncordova.plugins.printer.canPrintItem('file://css/index.css', callback);\n```\n\n## Sample\n\n```js\nvar options = {\n    font: {\n        size: 22,\n        italic: true,\n        align: 'center'\n    },\n    header: {\n        height: '6cm',\n        label: {\n            text: \"\\n\\nDie Freuden\",\n            font: {\n                bold: true,\n                size: 37,\n                align: 'center'\n            }\n        }\n    },\n    footer: {\n        height: '4cm',\n        label: {\n            text: 'Johann Wolfgang von Goethe, 1749-1832, deutscher Dichter, Naturforscher',\n            font: { align: 'center' }\n        }\n    }\n};\n\ncordova.plugins.printer.print(\"Es flattert um die Quelle\\nDie wechselnde Libelle,...\", options);\n```\n\nThe result will look like this for iOS:\n\n![ttt](https://github.com/katzer/cordova-plugin-printer/blob/example/images/sample.png)\n\n## Installation\n\nExecute from the projects root folder:\n\n    $ cordova plugin add cordova-plugin-printer\n\nOr install a specific version:\n\n    $ cordova plugin add cordova-plugin-printer@VERSION\n\nOr install the latest head version:\n\n    $ cordova plugin add https://github.com/katzer/cordova-plugin-printer.git\n\nOr install from local source:\n\n    $ cordova plugin add <path> --nofetch --nosave\n\nThen execute:\n\n    cordova build\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nThis software is released under the [Apache 2.0 License][apache2_license].\n\nMade with :yum: from Leipzig\n\n© 2013 [appPlant GmbH][appplant]\n\n\n[cordova]: https://cordova.apache.org\n[apache2_license]: http://opensource.org/licenses/Apache-2.0\n[appplant]: www.appplant.de\n","repository":{"type":"git","url":"git+https://github.com/katzer/cordova-plugin-printer.git"},"bugs":{"url":"https://github.com/katzer/cordova-plugin-printer/issues"},"license":"Apache 2.0","versions":{"0.7.2":{"name":"cordova-plugin-printer","version":"0.7.2","description":"Prints HTML documents","repository":{"type":"git","url":"git+https://github.com/katzer/cordova-plugin-printer.git"},"keywords":["appplant","printer","cordova","ecosystem:cordova"],"platforms":["ios","android","windows"],"engines":[{"name":"cordova","version":">=6.0.0"},{"name":"android-sdk","version":">=19"},{"name":"apple-ios","version":">=8.0"}],"author":{"name":"Sebastián Katzer"},"license":"Apache-2.0","bugs":{"url":"https://github.com/katzer/cordova-plugin-printer/issues"},"homepage":"https://github.com/katzer/cordova-plugin-printer#readme","gitHead":"ce9613b78f93ca7c969262709441c6af8ac33d7f","_id":"cordova-plugin-printer@0.7.2","scripts":{},"_shasum":"bc78c9e6bb378222713b5eab9908f6fd863277df","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.7","_npmUser":{"name":"anonymous","email":"katzer@appplant.de"},"dist":{"shasum":"bc78c9e6bb378222713b5eab9908f6fd863277df","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/cordova-plugin-printer/-/cordova-plugin-printer-0.7.2.tgz","integrity":"sha512-qtt3FCY1n1X2yRevIjndT3qpKwHshbc2Q25k1axN0ze0XWqFzvjJrm3/xnpK7i8SRjng0pELAK6qzEUV0RjyEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICVMne5JRK6Moy69y/O6wnmL4vMeeJwzLX/oI7eutUryAiAiKQO9lwgldIboTx+rg3aRKPethDMI8e5G2P3k50mh5A=="}]},"maintainers":[{"name":"anonymous","email":"katzer@appplant.de"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/cordova-plugin-printer-0.7.2.tgz_1470254251153_0.4000120928976685"},"directories":{}},"0.7.3":{"name":"cordova-plugin-printer","version":"0.7.3","description":"Prints HTML documents","repository":{"type":"git","url":"git+https://github.com/katzer/cordova-plugin-printer.git"},"keywords":["appplant","printer","cordova","ecosystem:cordova"],"platforms":["ios","android","windows"],"engines":[{"name":"cordova","version":">=6.0.0"},{"name":"android-sdk","version":">=19"},{"name":"apple-ios","version":">=8.0"}],"author":{"name":"Sebastián Katzer"},"license":"Apache-2.0","bugs":{"url":"https://github.com/katzer/cordova-plugin-printer/issues"},"homepage":"https://github.com/katzer/cordova-plugin-printer#readme","gitHead":"ac03532de51267709424ad456fb6bb743f943381","_id":"cordova-plugin-printer@0.7.3","scripts":{},"_shasum":"828dbd0b328b15b345d25c5e64c42c4ef3164586","_from":".","_npmVersion":"4.0.2","_nodeVersion":"4.6.1","_npmUser":{"name":"anonymous","email":"katzer@appplant.de"},"dist":{"shasum":"828dbd0b328b15b345d25c5e64c42c4ef3164586","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/cordova-plugin-printer/-/cordova-plugin-printer-0.7.3.tgz","integrity":"sha512-tUvgDhOmk8V+AKxCFN4mnmKc6ejVHhC6X/zXmxHN4+19eOqBw8WRFWpZuhAzMKu0l14BPFxaP1jxM86YHOQ2rA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSVbJ/RrlkQvJ7+7yT6lhpjjC4BQP3+VH95d3mK2FBgQIgPaYDGJGLU+GtiCB1+MG5B25vEoDMJ+Ro0iCTxxC8P2Y="}]},"maintainers":[{"name":"anonymous","email":"katzer@appplant.de"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/cordova-plugin-printer-0.7.3.tgz_1482157067755_0.5839182084891945"},"directories":{}},"0.8.0":{"name":"cordova-plugin-printer","version":"0.8.0","description":"Prints HTML documents","cordova":{"id":"cordova-plugin-printer","platforms":["ios","android","windows","browser"]},"repository":{"type":"git","url":"git+https://github.com/katzer/cordova-plugin-printer.git"},"keywords":["appplant","printer","cordova","ecosystem:cordova","cordova-ios","cordova-android","cordova-windows","cordova-browser"],"engines":[{"name":"cordova","version":">=3.0.0"},{"name":"android-sdk","version":">=19"},{"name":"apple-ios","version":">=8.0"}],"author":{"name":"Sebastián Katzer"},"license":"Apache 2.0","bugs":{"url":"https://github.com/katzer/cordova-plugin-printer/issues"},"homepage":"https://github.com/katzer/cordova-plugin-printer#readme","gitHead":"912eb5c0e650e97f1f5ebc96e6360bba3e21e696","_id":"cordova-plugin-printer@0.8.0","_nodeVersion":"11.10.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-Olu2SuCedztO6PtXoHwA4J/emOxZlj64Ya9aZhcxoXJITG+RDF6Nb3oThcpYPTa73+py+gPF7r19lv3Q8RR/Nw==","shasum":"9ae2e9e85dc1adfcce9d37a42d273e20b0914d0e","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/cordova-plugin-printer/-/cordova-plugin-printer-0.8.0.tgz","fileCount":35,"unpackedSize":136020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceZIoCRA9TVsSAnZWagAAytoP/0uktjX0Lfnsyhj/o91J\nw0mESkEMC0ckZQYA65wlL9sj0BPI0YiAk8f6jEv7aCxuv95Opb43Jg7CmwcM\nd0uyl45e5RG6qUcL4R2hEQ0jwxZH+MvJaGqHfHA7Ky5r9oCejXNvHoarv44q\nfTols8Om8uO0L42zkrC5iuW0699+/eP9NYkyOdNchZWLR8ZtqeMgCXtso5cf\nQRPGAPl7QAnxkrTjfmPxTC+3gWoouDVOgMVvtZXV75iNXG0PsOmdN6Akxi+v\n51CScBZZQmu6y1JHLejxHKDMvqBPsu5gRS+kBF9WIeGyBHgW6YpiAJEfA8To\ndhzqXLPkLuELEJ+7naCIftBzZwLdOic8V3nxiHTJNLuH/uKkHc3VeupLXCbP\naV0ZLfBkJxwxWZfyItEv0JyGh0Pk7eN/iq7B9hliRzwDBlXqwOFSofdC2eU2\n0EI5ovRRzr6EPoDE6SviV1Qnw4ea4CH48T2MduKJffrXpKAEbmNAeGy1kARq\nBzoi7RLpx9D8C5pWODe5D6dSo+EjlSVOZ4IXW0uHmuDU2FahLDlKtA1AYbE8\nAqpuGTjfmDsRgQFA7FTZg18o3XludV/kx/gYEV4N7lsjFtIYW4Ph5T513v8z\nf0L1OwPK8xPig7+P9wytTTeHC5qVQd3R9QiERxZqgGmWkPHe6tpRHoERYBJs\n2Zq+\r\n=gJ8i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5gd5oAWuFvP/N0Uu+VvE3EZkBmEeyNHlXZ5nKkolHuAiEA1edw5ym/Omx5zW5zQBcSwsjEXU9ddFgrGKWgTp01G38="}]},"maintainers":[{"name":"anonymous","email":"katzer@appplant.de"}],"_npmUser":{"name":"anonymous","email":"katzer@appplant.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cordova-plugin-printer_0.8.0_1551471143697_0.113992686253783"},"_hasShrinkwrap":false}},"name":"cordova-plugin-printer","time":{"modified":"2022-06-14T00:40:52.496Z","created":"2016-08-03T19:57:32.614Z","0.7.2":"2016-08-03T19:57:32.614Z","0.7.3":"2016-12-19T14:17:49.760Z","0.8.0":"2019-03-01T20:12:23.820Z"},"readmeFilename":"README.md","homepage":"https://github.com/katzer/cordova-plugin-printer#readme"}