jspdf-utils 0.5.2 → 0.5.4
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/README.md +28 -0
- package/dist/html-to-pdf.js +1317 -1231
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,34 @@ Important:
|
|
|
130
130
|
continues onto — at most once per page.
|
|
131
131
|
- Set to `false` to render the header only once, where the table starts.
|
|
132
132
|
|
|
133
|
+
`html2canvasOptions` behavior:
|
|
134
|
+
|
|
135
|
+
- Forwarded to html2canvas by `generatePDF`, `generateImagePDF`, and
|
|
136
|
+
`generateImages` (`scale` is always derived from the page layout and cannot
|
|
137
|
+
be overridden).
|
|
138
|
+
- html2canvas clones the whole document into its render iframe. Since 0.5.3
|
|
139
|
+
the library prunes that clone to `<head>` plus the render element and its
|
|
140
|
+
ancestors, so the rest of the page (a large app UI, other offscreen copies)
|
|
141
|
+
is neither cloned nor waited on. A caller-supplied `ignoreElements` is
|
|
142
|
+
applied on top of that pruning.
|
|
143
|
+
- `imageTimeout` defaults to 60s (html2canvas' own default is 15s), so a
|
|
144
|
+
document with hundreds of photos isn't cut short while the last ones decode.
|
|
145
|
+
- `generatePDF` hands html2canvas its own, uncapped image `cache`.
|
|
146
|
+
html2canvas-pro ≥ 2 caps its cache at 100 entries (LRU) and offers no option
|
|
147
|
+
to raise it; a document with more images than that lost its FIRST images
|
|
148
|
+
(evicted while parsing, before they were drawn). Pass your own `cache` or a
|
|
149
|
+
`proxy` to keep html2canvas' cache instead.
|
|
150
|
+
|
|
151
|
+
Image handling (`generatePDF`):
|
|
152
|
+
|
|
153
|
+
- Every `<img>` larger than 2× its laid-out size is redrawn at 2× and
|
|
154
|
+
re-encoded before rendering, so the PDF never embeds full-resolution
|
|
155
|
+
originals. Since 0.5.3 the re-encode is JPEG (quality 0.9); an image whose
|
|
156
|
+
pixels actually use transparency is kept as PNG so its alpha survives.
|
|
157
|
+
- Images already at or below 2× and supplied as data-URLs are embedded as-is.
|
|
158
|
+
Supplying print-sized JPEG data-URLs up front therefore skips the canvas
|
|
159
|
+
pass entirely.
|
|
160
|
+
|
|
133
161
|
## Margin Content and Borders
|
|
134
162
|
|
|
135
163
|
`marginContent`, `border`, and `textBorder` are independent, top-level page
|