p3x-html-pdf 2025.4.122 β†’ 2025.4.125

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 (2) hide show
  1. package/README.md +63 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- # πŸ“ƒ Generates PDF from HTML with custom headers and footers with wkhtmltopdf v2025.4.122
9
+ # πŸ“ƒ Generates PDF from HTML with custom headers and footers with wkhtmltopdf v2025.4.125
10
10
 
11
11
 
12
12
 
@@ -152,6 +152,10 @@ const path = require('path');
152
152
  - `html`: HTML content with placeholders.
153
153
  - **title**: PDF document title.
154
154
  - **saveFile**: Path for saving the PDF.
155
+ - **base** The HTML base href is other then current directory, it can be online as well.
156
+ - **css**: Customize the CSS for serving, by default it is in `src/ng-html-template.css`
157
+ - **jquery**: The latest that works with webkit is jQuery v1.12.4
158
+ - **javascriptDelay**: The delay before the PDF is generated as default is 1000 ms.
155
159
 
156
160
  For more options, check the official [wkhtmltopdf usage guide](https://wkhtmltopdf.org/usage/wkhtmltopdf.txt).
157
161
 
@@ -204,9 +208,64 @@ Check out an example output PDF:
204
208
 
205
209
  ---
206
210
 
207
- ## License
211
+ # Puppeteer vs. p3x-html-pdf: Resource Usage and Features Comparison
208
212
 
209
- This project is licensed under the MIT License.
213
+ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to understand their differences in resource usage and capabilities.
214
+
215
+ ## Technology Difference
216
+
217
+ - **p3x-html-pdf** is built on **wkhtmltopdf**, which uses the WebKit rendering engine. It's lightweight and optimized for HTML-to-PDF tasks.
218
+ - **Puppeteer** launches a full **Chrome/Chromium** instance, consuming more CPU and memory, even in headless mode.
219
+
220
+ ## Resource Usage Comparison
221
+
222
+ | Feature | p3x-html-pdf (wkhtmltopdf) | Puppeteer (Chrome/Chromium) |
223
+ |------------------------|---------------------------------------------|------------------------------------------|
224
+ | **Memory Usage** | Low | High |
225
+ | **CPU Usage** | Low | High |
226
+ | **Startup Time** | Fast | Slower due to browser launch |
227
+ | **Dynamic Content** | Limited support for JavaScript | Full support for JavaScript |
228
+ | **Rendering Accuracy** | Basic CSS and HTML support | Pixel-perfect rendering with modern web standards |
229
+ | **Flexibility** | Headers, footers, scripts (older JS versions) | Highly customizable (headers, footers, scripts) |
230
+ | **Scalability** | Suitable for lightweight tasks and servers | Better for advanced use cases and large-scale rendering |
231
+ | **File Size** | Smaller binary for wkhtmltopdf dependency | Puppeteer requires downloading Chromium (~100MB) |
232
+
233
+ ## Trade-offs
234
+
235
+ ### p3x-html-pdf (wkhtmltopdf)
236
+ - **Pros:**
237
+ - Lightweight and uses fewer resources.
238
+ - Faster startup time.
239
+ - Ideal for static HTML content with minimal JavaScript or CSS.
240
+
241
+ - **Cons:**
242
+ - Limited support for modern web standards and advanced JavaScript.
243
+ - Basic rendering capabilities.
244
+
245
+ ### Puppeteer
246
+ - **Pros:**
247
+ - Full support for dynamic content, advanced JavaScript, and modern web standards.
248
+ - Highly customizable headers, footers, and PDF options.
249
+ - Pixel-perfect rendering accuracy.
250
+
251
+ - **Cons:**
252
+ - Consumes more CPU and memory.
253
+ - Slower startup time due to launching a full Chrome/Chromium instance.
254
+
255
+ ## When to Use Each
256
+
257
+ ### Use **p3x-html-pdf (wkhtmltopdf)**:
258
+ - When your content is **static** or doesn’t rely on modern web technologies.
259
+ - When resource efficiency is a priority (e.g., on resource-constrained servers).
260
+
261
+ ### Use **Puppeteer**:
262
+ - When your content is **dynamic** or relies heavily on JavaScript and CSS.
263
+ - When rendering accuracy, modern web technology support, or customization is critical.
264
+
265
+ ## Conclusion
266
+
267
+ - **p3x-html-pdf** (wkhtmltopdf) is a better fit for lightweight tasks with simple requirements.
268
+ - **Puppeteer** excels in advanced and dynamic use cases but comes with higher resource costs.
210
269
 
211
270
  ---
212
271
 
@@ -257,7 +316,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
257
316
  ---
258
317
 
259
318
 
260
- [**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.122
319
+ [**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.125
261
320
 
262
321
  [![NPM](https://img.shields.io/npm/v/p3x-html-pdf.svg)](https://www.npmjs.com/package/p3x-html-pdf) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
263
322
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p3x-html-pdf",
3
- "version": "2025.4.122",
3
+ "version": "2025.4.125",
4
4
  "corifeus": {
5
5
  "prefix": "p3x-",
6
6
  "publish": true,