{"id":16429783,"url":"https://github.com/pavankjadda/ngx-printx","last_synced_at":"2026-05-17T05:37:35.015Z","repository":{"id":38577743,"uuid":"252802828","full_name":"pavankjadda/ngx-printx","owner":"pavankjadda","description":"Angular 9+ print HTML","archived":false,"fork":false,"pushed_at":"2023-05-10T05:43:01.000Z","size":2312,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T22:36:53.950Z","etag":null,"topics":["angular"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ngx-printx","language":"TypeScript","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/pavankjadda.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-03T17:56:02.000Z","updated_at":"2020-08-08T05:12:24.000Z","dependencies_parsed_at":"2024-11-10T15:46:10.288Z","dependency_job_id":null,"html_url":"https://github.com/pavankjadda/ngx-printx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankjadda%2Fngx-printx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankjadda%2Fngx-printx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankjadda%2Fngx-printx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankjadda%2Fngx-printx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavankjadda","download_url":"https://codeload.github.com/pavankjadda/ngx-printx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240627959,"owners_count":19831600,"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":["angular"],"created_at":"2024-10-11T08:24:22.185Z","updated_at":"2026-05-17T05:37:29.996Z","avatar_url":"https://github.com/pavankjadda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ngx-printx : *plug n' play Angular (2++) directive to print your stuff*\nThis directive makes printing your HTML sections smooth and easy in your Angular application. It is intended to use with the new Angular -2+\n\n## Setup\n\n **1-** In your root application folder run:\n```bash\n$ npm install ngx-printx\n```\n\n **2-** Once `ngx-printx` is installed, you need to import the main module `NgxPrintModule` :\n\n   ```js\nimport {NgxPrintModule} from 'ngx-printx';\n\n@NgModule({\n  ...\n  imports: [NgxPrintModule, ...],\n  ...\n})\nexport class YourAppModule {\n}\n```\n\n **3-** Then plug n' play with it: \n\n - Assuming you want to print the following HTML section:\n\n```html\n\u003cdiv\u003e\n  \u003c!--Your html stuff that you want to print--\u003e\n\u003c/div\u003e\n\u003cbutton\u003eprint\u003c/button\u003e \u003c!--Your relevant print button--\u003e\n\n```\n\n - Now, what you have to do is tagging your *wanted-to-print* section by an `id` attribute, then link that `id` to a directive parameter in your button :\n\n```html\n \u003c!--\n   1)- Add an ID here\n --\u003e\n\u003cdiv id=\"print-section\"\u003e \n  \u003c!--Your html stuff that you want to print--\u003e\n\u003c/div\u003e\n\n \u003c!--\n   2)- Add the directive name in your button (ngxPrint),\n   3)- Affect your ID to printSectionId\n --\u003e\n\u003cbutton printSectionId=\"print-section\" ngxPrint\u003eprint\u003c/button\u003e \n\n```\n## Optional properties\n\n- You want a customized title for your printing window ? you have the choice by adding a new attribute to your print button `printTitle`:\n\n\n```html\n\n\u003cdiv  id=\"print-section\"\u003e\n\n\u003c!-- ... --\u003e\n\n\u003c/div\u003e\n\n\u003cbutton  \n\tprintTitle=\"MyTitle\"  \n\tprintSectionId=\"print-section\"  \n\tngxPrint\u003eprint\u003c/button\u003e\n\n```\n\n  \n- Also, would you like to customize the printing window style sheet (CSS) ? Hence you can do so by adding infinite styles to another attribute called `printStyle`:\n\n  \n```html\n\n\u003cdiv  id=\"print-section\"\u003e\n\n\u003c!-- ... --\u003e\n\n\u003c/div\u003e\n\n\u003cbutton\n\t[printStyle]=\"{h1 : {'color': 'red'}, h2 : {'border': 'solid 1px'}}\"\n\tprintSectionId=\"print-section\"\n\tngxPrint\u003eprint\u003c/button\u003e\n\n```\n\nHere some simple styles were added to every `h1` \u0026 `h2` tags within the `div` where `print-section` is tagged to its `id` attribute.\n  \n- If you would like to use your existing CSS with media print you can add the `useExistingCss` attribute:\n\n```html\n\n\u003cdiv  id=\"print-section\"\u003e\n\n\u003c!-- ... --\u003e\n\n\u003c/div\u003e\n\n\u003cbutton\n  [useExistingCss]=\"true\"\n\tprintSectionId=\"print-section\"\n\tngxPrint\u003eprint\u003c/button\u003e\n\n```\n\n- If you want to customize the printing window style sheet (CSS) by importing the css provided in assets/css use `styleSheetFile`:\n\n\n```html\n\n\u003cdiv  id=\"print-section\"\u003e\n\n\u003c!-- ... --\u003e\n\n\u003c/div\u003e\n\n\u003cbutton\n  styleSheetFile=\"assets/css/custom1.css,assets/css/custom2.css\"\n  printSectionId=\"print-section\"\n  ngxPrint\u003eprint\u003c/button\u003e\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavankjadda%2Fngx-printx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavankjadda%2Fngx-printx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavankjadda%2Fngx-printx/lists"}