ngx-pdf-export 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohammed Abdul Shahed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # ngx-pdf-export
2
+
3
+ A DOM-aware, client-side Angular library that exports a rendered
4
+ Angular/HTML element into a real PDF — with actual selectable, searchable,
5
+ copy-pasteable PDF text — entirely in the browser. No backend, no API
6
+ calls, and no `html2canvas`-style screenshot-to-image pipeline.
7
+
8
+ ```bash
9
+ npm install ngx-pdf-export
10
+ ```
11
+
12
+ ```ts
13
+ import { PdfExportService } from 'ngx-pdf-export';
14
+
15
+ constructor(private pdf: PdfExportService) {}
16
+
17
+ async exportDashboard() {
18
+ await this.pdf.download('#dashboard', 'dashboard.pdf', {
19
+ format: 'A4',
20
+ orientation: 'landscape',
21
+ });
22
+ }
23
+ ```
24
+
25
+ It reads the browser's own already-computed layout
26
+ (`getBoundingClientRect`, `getComputedStyle`, and per-line text boxes via
27
+ `Range.getClientRects`) and replays it as real PDF drawing/text operators,
28
+ instead of rasterizing the page. Only the rare element using a CSS feature
29
+ this library doesn't translate (gradients, box-shadow, CSS filters) is
30
+ rasterized — and only that one element, never the whole page.
31
+
32
+ ## Also available
33
+
34
+ - `PdfExportDirective` (`[pdfExport]`) for template-driven export.
35
+ - `toBlob()` / `download()` / `export()` on `PdfExportService`.
36
+ - `registerFont()` for custom TTF/OTF fonts (required for non-Latin
37
+ Unicode text — see the Unicode note below).
38
+ - Multi-page pagination with `keepTogether`, `break-before`/`break-after`,
39
+ and repeated table headers.
40
+ - Headers/footers with page numbers (`Page X of Y`).
41
+ - A `debug: true` mode that outlines page boundaries and rasterized
42
+ fallback elements directly on the output PDF.
43
+
44
+ ## Unicode note
45
+
46
+ The default (Standard-14) fonts only support Latin-1-ish text. For ₹,
47
+ Arabic, Devanagari, CJK, or most accented characters, register a Unicode
48
+ TTF/OTF font first:
49
+
50
+ ```ts
51
+ await pdf.registerFont({ family: 'Noto Sans', src: '/fonts/NotoSans-Regular.ttf', weight: 400 });
52
+ ```
53
+
54
+ Use a **static** font file (a single weight/style), not a variable font —
55
+ `@pdf-lib/fontkit` does not subset variable fonts correctly.
56
+
57
+ ## Documentation
58
+
59
+ Full architecture docs, CSS support matrix, pagination algorithm, and API
60
+ design are in the [repository's `docs/` folder](https://github.com/mdabdulshahed/angular-pdf/tree/main/docs).
61
+
62
+ ## License
63
+
64
+ MIT