jspdf-utils 0.5.1 → 0.5.3

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.
Files changed (3) hide show
  1. package/README.md +23 -0
  2. package/dist/html-to-pdf.js +1344 -1301
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -130,6 +130,29 @@ 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
+
146
+ Image handling (`generatePDF`):
147
+
148
+ - Every `<img>` larger than 2× its laid-out size is redrawn at 2× and
149
+ re-encoded before rendering, so the PDF never embeds full-resolution
150
+ originals. Since 0.5.3 the re-encode is JPEG (quality 0.9); an image whose
151
+ pixels actually use transparency is kept as PNG so its alpha survives.
152
+ - Images already at or below 2× and supplied as data-URLs are embedded as-is.
153
+ Supplying print-sized JPEG data-URLs up front therefore skips the canvas
154
+ pass entirely.
155
+
133
156
  ## Margin Content and Borders
134
157
 
135
158
  `marginContent`, `border`, and `textBorder` are independent, top-level page