p3x-html-pdf 2025.4.132 β 2025.4.133
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 +12 -12
- package/package.json +1 -1
- package/release/wkhtmltox/bin/wkhtmltoimage +0 -0
- package/release/wkhtmltox/bin/wkhtmltopdf +0 -0
- package/release/wkhtmltox/include/wkhtmltox/dllbegin.inc +0 -52
- package/release/wkhtmltox/include/wkhtmltox/dllend.inc +0 -28
- package/release/wkhtmltox/include/wkhtmltox/image.h +0 -64
- package/release/wkhtmltox/include/wkhtmltox/pdf.h +0 -76
- package/release/wkhtmltox/lib/libwkhtmltox.so.0.12.4 +0 -0
- package/release/wkhtmltox/share/man/man1/wkhtmltoimage.1.gz +0 -0
- package/release/wkhtmltox/share/man/man1/wkhtmltopdf.1.gz +0 -0
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.
|
|
9
|
+
# π Generates PDF from HTML with custom headers and footers with wkhtmltopdf v2025.4.133
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -266,16 +266,16 @@ For instance, the following layout works seamlessly:
|
|
|
266
266
|
```
|
|
267
267
|
---
|
|
268
268
|
|
|
269
|
-
|
|
269
|
+
## Puppeteer vs. p3x-html-pdf: Resource Usage and Features Comparison
|
|
270
270
|
|
|
271
271
|
When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to understand their differences in resource usage and capabilities.
|
|
272
272
|
|
|
273
|
-
|
|
273
|
+
### Technology Difference
|
|
274
274
|
|
|
275
275
|
- **p3x-html-pdf** is built on **wkhtmltopdf**, which uses the WebKit rendering engine. It's lightweight and optimized for HTML-to-PDF tasks.
|
|
276
276
|
- **Puppeteer** launches a full **Chrome/Chromium** instance, consuming more CPU and memory, even in headless mode.
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
### Resource Usage Comparison
|
|
279
279
|
|
|
280
280
|
| Feature | p3x-html-pdf (wkhtmltopdf) | Puppeteer (Chrome/Chromium) |
|
|
281
281
|
|------------------------|---------------------------------------------|------------------------------------------|
|
|
@@ -288,9 +288,9 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
288
288
|
| **Scalability** | Suitable for lightweight tasks and servers | Better for advanced use cases and large-scale rendering |
|
|
289
289
|
| **File Size** | Smaller binary for wkhtmltopdf dependency | Puppeteer requires downloading Chromium (~100MB) |
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
### Trade-offs
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
#### p3x-html-pdf (wkhtmltopdf)
|
|
294
294
|
- **Pros:**
|
|
295
295
|
- Lightweight and uses fewer resources.
|
|
296
296
|
- Faster startup time.
|
|
@@ -300,7 +300,7 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
300
300
|
- Limited support for modern web standards and advanced JavaScript.
|
|
301
301
|
- Basic rendering capabilities.
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
#### Puppeteer
|
|
304
304
|
- **Pros:**
|
|
305
305
|
- Full support for dynamic content, advanced JavaScript, and modern web standards.
|
|
306
306
|
- Highly customizable headers, footers, and PDF options.
|
|
@@ -310,17 +310,17 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
310
310
|
- Consumes more CPU and memory.
|
|
311
311
|
- Slower startup time due to launching a full Chrome/Chromium instance.
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
### When to Use Each
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
#### Use p3x-html-pdf (wkhtmltopdf):
|
|
316
316
|
- When your content is **static** or doesnβt rely on modern web technologies.
|
|
317
317
|
- When resource efficiency is a priority (e.g., on resource-constrained servers).
|
|
318
318
|
|
|
319
|
-
|
|
319
|
+
#### Use Puppeteer:
|
|
320
320
|
- When your content is **dynamic** or relies heavily on JavaScript and CSS.
|
|
321
321
|
- When rendering accuracy, modern web technology support, or customization is critical.
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
### Conclusion
|
|
324
324
|
|
|
325
325
|
- **p3x-html-pdf** (wkhtmltopdf) is a better fit for lightweight tasks with simple requirements.
|
|
326
326
|
- **Puppeteer** excels in advanced and dynamic use cases but comes with higher resource costs.
|
|
@@ -374,7 +374,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
|
|
|
374
374
|
---
|
|
375
375
|
|
|
376
376
|
|
|
377
|
-
[**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.
|
|
377
|
+
[**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.133
|
|
378
378
|
|
|
379
379
|
[](https://www.npmjs.com/package/p3x-html-pdf) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
|
|
380
380
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2010 wkhtmltopdf authors
|
|
3
|
-
*
|
|
4
|
-
* This file is part of wkhtmltopdf.
|
|
5
|
-
*
|
|
6
|
-
* wkhtmltopdf is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* wkhtmltopdf is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
* along with wkhtmltopdf. If not, see <http: *www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifndef __WKHTMLTOPDF_DLLBEGIN__
|
|
21
|
-
#define __WKHTMLTOPDF_DLLBEGIN__
|
|
22
|
-
|
|
23
|
-
#if defined _WIN32 || defined __CYGWIN__
|
|
24
|
-
#ifdef BUILDING_DLL
|
|
25
|
-
#define DLL_PUBLIC __declspec(dllexport)
|
|
26
|
-
#else
|
|
27
|
-
#define DLL_PUBLIC __declspec(dllimport)
|
|
28
|
-
#endif
|
|
29
|
-
#define DLL_LOCAL
|
|
30
|
-
#else
|
|
31
|
-
#if __GNUC__ >= 4
|
|
32
|
-
#define DLL_PUBLIC __attribute__ ((visibility("default")))
|
|
33
|
-
#define DLL_LOCAL __attribute__ ((visibility("hidden")))
|
|
34
|
-
#else
|
|
35
|
-
#define DLL_PUBLIC
|
|
36
|
-
#define DLL_LOCAL
|
|
37
|
-
#endif
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
#if defined _WIN32
|
|
41
|
-
#define CALLTYPE __stdcall
|
|
42
|
-
#else
|
|
43
|
-
#define CALLTYPE
|
|
44
|
-
#endif
|
|
45
|
-
|
|
46
|
-
#ifdef __cplusplus
|
|
47
|
-
#define CAPI(type) extern "C" DLL_PUBLIC type CALLTYPE
|
|
48
|
-
#else
|
|
49
|
-
#define CAPI(type) DLL_PUBLIC type CALLTYPE
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
#endif /*__WKHTMLTOPDF_DLLBEGIN__*/
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2010 wkhtmltopdf authors
|
|
3
|
-
*
|
|
4
|
-
* This file is part of wkhtmltopdf.
|
|
5
|
-
*
|
|
6
|
-
* wkhtmltopdf is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* wkhtmltopdf is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
* along with wkhtmltopdf. If not, see <http: *www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifdef __WKHTMLTOPDF_DLLBEGIN__
|
|
21
|
-
|
|
22
|
-
#undef __WKHTMLTOPDF_DLLBEGIN__
|
|
23
|
-
#undef DLL_PUBLIC
|
|
24
|
-
#undef DLL_LOCAL
|
|
25
|
-
#undef CAPI
|
|
26
|
-
#undef CALLTYPE
|
|
27
|
-
|
|
28
|
-
#endif /*__WKHTMLTOPDF_DLLBEGIN__*/
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2010 wkhtmltopdf authors
|
|
3
|
-
*
|
|
4
|
-
* This file is part of wkhtmltopdf.
|
|
5
|
-
*
|
|
6
|
-
* wkhtmltopdf is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* wkhtmltopdf is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
* along with wkhtmltopdf. If not, see <http: *www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifndef __IMAGE_H__
|
|
21
|
-
#define __IMAGE_H__
|
|
22
|
-
#include <wkhtmltox/dllbegin.inc>
|
|
23
|
-
|
|
24
|
-
struct wkhtmltoimage_global_settings;
|
|
25
|
-
typedef struct wkhtmltoimage_global_settings wkhtmltoimage_global_settings;
|
|
26
|
-
|
|
27
|
-
struct wkhtmltoimage_converter;
|
|
28
|
-
typedef struct wkhtmltoimage_converter wkhtmltoimage_converter;
|
|
29
|
-
|
|
30
|
-
typedef void (*wkhtmltoimage_str_callback)(wkhtmltoimage_converter * converter, const char * str);
|
|
31
|
-
typedef void (*wkhtmltoimage_int_callback)(wkhtmltoimage_converter * converter, const int val);
|
|
32
|
-
typedef void (*wkhtmltoimage_void_callback)(wkhtmltoimage_converter * converter);
|
|
33
|
-
|
|
34
|
-
CAPI(int) wkhtmltoimage_init(int use_graphics);
|
|
35
|
-
CAPI(int) wkhtmltoimage_deinit();
|
|
36
|
-
CAPI(int) wkhtmltoimage_extended_qt();
|
|
37
|
-
CAPI(const char *)wkhtmltoimage_version();
|
|
38
|
-
|
|
39
|
-
CAPI(wkhtmltoimage_global_settings *) wkhtmltoimage_create_global_settings();
|
|
40
|
-
|
|
41
|
-
CAPI(int) wkhtmltoimage_set_global_setting(wkhtmltoimage_global_settings * settings, const char * name, const char * value);
|
|
42
|
-
CAPI(int) wkhtmltoimage_get_global_setting(wkhtmltoimage_global_settings * settings, const char * name, char * value, int vs);
|
|
43
|
-
|
|
44
|
-
CAPI(wkhtmltoimage_converter *) wkhtmltoimage_create_converter(wkhtmltoimage_global_settings * settings, const char * data);
|
|
45
|
-
CAPI(void) wkhtmltoimage_destroy_converter(wkhtmltoimage_converter * converter);
|
|
46
|
-
|
|
47
|
-
CAPI(void) wkhtmltoimage_set_warning_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_str_callback cb);
|
|
48
|
-
CAPI(void) wkhtmltoimage_set_error_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_str_callback cb);
|
|
49
|
-
CAPI(void) wkhtmltoimage_set_phase_changed_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_void_callback cb);
|
|
50
|
-
CAPI(void) wkhtmltoimage_set_progress_changed_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_int_callback cb);
|
|
51
|
-
CAPI(void) wkhtmltoimage_set_finished_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_int_callback cb);
|
|
52
|
-
CAPI(int) wkhtmltoimage_convert(wkhtmltoimage_converter * converter);
|
|
53
|
-
/* CAPI(void) wkhtmltoimage_begin_conversion(wkhtmltoimage_converter * converter); */
|
|
54
|
-
/* CAPI(void) wkhtmltoimage_cancel(wkhtmltoimage_converter * converter); */
|
|
55
|
-
|
|
56
|
-
CAPI(int) wkhtmltoimage_current_phase(wkhtmltoimage_converter * converter);
|
|
57
|
-
CAPI(int) wkhtmltoimage_phase_count(wkhtmltoimage_converter * converter);
|
|
58
|
-
CAPI(const char *) wkhtmltoimage_phase_description(wkhtmltoimage_converter * converter, int phase);
|
|
59
|
-
CAPI(const char *) wkhtmltoimage_progress_string(wkhtmltoimage_converter * converter);
|
|
60
|
-
CAPI(int) wkhtmltoimage_http_error_code(wkhtmltoimage_converter * converter);
|
|
61
|
-
CAPI(long) wkhtmltoimage_get_output(wkhtmltoimage_converter * converter, const unsigned char **);
|
|
62
|
-
|
|
63
|
-
#include <wkhtmltox/dllend.inc>
|
|
64
|
-
#endif /*__IMAGE_H__*/
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2010 wkhtmltopdf authors
|
|
3
|
-
*
|
|
4
|
-
* This file is part of wkhtmltopdf.
|
|
5
|
-
*
|
|
6
|
-
* wkhtmltopdf is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
8
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
* (at your option) any later version.
|
|
10
|
-
*
|
|
11
|
-
* wkhtmltopdf is distributed in the hope that it will be useful,
|
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
* GNU General Public License for more details.
|
|
15
|
-
*
|
|
16
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
-
* along with wkhtmltopdf. If not, see <http: *www.gnu.org/licenses/>.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifndef __PDF_H__
|
|
21
|
-
#define __PDF_H__
|
|
22
|
-
#include <wkhtmltox/dllbegin.inc>
|
|
23
|
-
|
|
24
|
-
struct wkhtmltopdf_global_settings;
|
|
25
|
-
typedef struct wkhtmltopdf_global_settings wkhtmltopdf_global_settings;
|
|
26
|
-
|
|
27
|
-
struct wkhtmltopdf_object_settings;
|
|
28
|
-
typedef struct wkhtmltopdf_object_settings wkhtmltopdf_object_settings;
|
|
29
|
-
|
|
30
|
-
struct wkhtmltopdf_converter;
|
|
31
|
-
typedef struct wkhtmltopdf_converter wkhtmltopdf_converter;
|
|
32
|
-
|
|
33
|
-
typedef void (*wkhtmltopdf_str_callback)(wkhtmltopdf_converter * converter, const char * str);
|
|
34
|
-
typedef void (*wkhtmltopdf_int_callback)(wkhtmltopdf_converter * converter, const int val);
|
|
35
|
-
typedef void (*wkhtmltopdf_void_callback)(wkhtmltopdf_converter * converter);
|
|
36
|
-
|
|
37
|
-
CAPI(int) wkhtmltopdf_init(int use_graphics);
|
|
38
|
-
CAPI(int) wkhtmltopdf_deinit();
|
|
39
|
-
CAPI(int) wkhtmltopdf_extended_qt();
|
|
40
|
-
CAPI(const char *) wkhtmltopdf_version();
|
|
41
|
-
|
|
42
|
-
CAPI(wkhtmltopdf_global_settings *) wkhtmltopdf_create_global_settings();
|
|
43
|
-
CAPI(void) wkhtmltopdf_destroy_global_settings(wkhtmltopdf_global_settings *);
|
|
44
|
-
|
|
45
|
-
CAPI(wkhtmltopdf_object_settings *) wkhtmltopdf_create_object_settings();
|
|
46
|
-
CAPI(void) wkhtmltopdf_destroy_object_settings(wkhtmltopdf_object_settings *);
|
|
47
|
-
|
|
48
|
-
CAPI(int) wkhtmltopdf_set_global_setting(wkhtmltopdf_global_settings * settings, const char * name, const char * value);
|
|
49
|
-
CAPI(int) wkhtmltopdf_get_global_setting(wkhtmltopdf_global_settings * settings, const char * name, char * value, int vs);
|
|
50
|
-
CAPI(int) wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings * settings, const char * name, const char * value);
|
|
51
|
-
CAPI(int) wkhtmltopdf_get_object_setting(wkhtmltopdf_object_settings * settings, const char * name, char * value, int vs);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
CAPI(wkhtmltopdf_converter *) wkhtmltopdf_create_converter(wkhtmltopdf_global_settings * settings);
|
|
55
|
-
CAPI(void) wkhtmltopdf_destroy_converter(wkhtmltopdf_converter * converter);
|
|
56
|
-
|
|
57
|
-
CAPI(void) wkhtmltopdf_set_warning_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback cb);
|
|
58
|
-
CAPI(void) wkhtmltopdf_set_error_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback cb);
|
|
59
|
-
CAPI(void) wkhtmltopdf_set_phase_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_void_callback cb);
|
|
60
|
-
CAPI(void) wkhtmltopdf_set_progress_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_int_callback cb);
|
|
61
|
-
CAPI(void) wkhtmltopdf_set_finished_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_int_callback cb);
|
|
62
|
-
/* CAPI(void) wkhtmltopdf_begin_conversion(wkhtmltopdf_converter * converter); */
|
|
63
|
-
/* CAPI(void) wkhtmltopdf_cancel(wkhtmltopdf_converter * converter); */
|
|
64
|
-
CAPI(int) wkhtmltopdf_convert(wkhtmltopdf_converter * converter);
|
|
65
|
-
CAPI(void) wkhtmltopdf_add_object(
|
|
66
|
-
wkhtmltopdf_converter * converter, wkhtmltopdf_object_settings * setting, const char * data);
|
|
67
|
-
|
|
68
|
-
CAPI(int) wkhtmltopdf_current_phase(wkhtmltopdf_converter * converter);
|
|
69
|
-
CAPI(int) wkhtmltopdf_phase_count(wkhtmltopdf_converter * converter);
|
|
70
|
-
CAPI(const char *) wkhtmltopdf_phase_description(wkhtmltopdf_converter * converter, int phase);
|
|
71
|
-
CAPI(const char *) wkhtmltopdf_progress_string(wkhtmltopdf_converter * converter);
|
|
72
|
-
CAPI(int) wkhtmltopdf_http_error_code(wkhtmltopdf_converter * converter);
|
|
73
|
-
CAPI(long) wkhtmltopdf_get_output(wkhtmltopdf_converter * converter, const unsigned char **);
|
|
74
|
-
|
|
75
|
-
#include <wkhtmltox/dllend.inc>
|
|
76
|
-
#endif /*__PDF_H__*/
|
|
Binary file
|
|
Binary file
|
|
Binary file
|