p3x-html-pdf 2025.4.131 β 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 +23 -15
- 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
|
|
|
@@ -196,9 +196,17 @@ The `p3x-footer` and `p3x-header` should not have any styles other than `id` and
|
|
|
196
196
|
|
|
197
197
|
### ARM64 Support
|
|
198
198
|
|
|
199
|
-
If `os.arch() === 'arm64'`, the package automatically
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
If `os.arch() === 'arm64'`, the package will automatically set the `wkhtmltopdf` path to:
|
|
200
|
+
`/usr/local/bin/wkhtmltopdf-arm64`
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
To use this functionality, you must manually download the binary and place it in the specified location.
|
|
204
|
+
You can download the ARM64 binary from the link below:
|
|
205
|
+
|
|
206
|
+
[Download wkhtmltopdf-arm64 binary](https://github.com/houseoftech/wkhtmltopdf-arm64/raw/refs/heads/master/bin/wkhtmltopdf-arm64)
|
|
207
|
+
|
|
208
|
+
Currently, the ARM64 binary setup is manual. If there is sufficient demand, an automated installation process may be implemented in the future.
|
|
209
|
+
|
|
202
210
|
|
|
203
211
|
---
|
|
204
212
|
|
|
@@ -258,16 +266,16 @@ For instance, the following layout works seamlessly:
|
|
|
258
266
|
```
|
|
259
267
|
---
|
|
260
268
|
|
|
261
|
-
|
|
269
|
+
## Puppeteer vs. p3x-html-pdf: Resource Usage and Features Comparison
|
|
262
270
|
|
|
263
271
|
When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to understand their differences in resource usage and capabilities.
|
|
264
272
|
|
|
265
|
-
|
|
273
|
+
### Technology Difference
|
|
266
274
|
|
|
267
275
|
- **p3x-html-pdf** is built on **wkhtmltopdf**, which uses the WebKit rendering engine. It's lightweight and optimized for HTML-to-PDF tasks.
|
|
268
276
|
- **Puppeteer** launches a full **Chrome/Chromium** instance, consuming more CPU and memory, even in headless mode.
|
|
269
277
|
|
|
270
|
-
|
|
278
|
+
### Resource Usage Comparison
|
|
271
279
|
|
|
272
280
|
| Feature | p3x-html-pdf (wkhtmltopdf) | Puppeteer (Chrome/Chromium) |
|
|
273
281
|
|------------------------|---------------------------------------------|------------------------------------------|
|
|
@@ -280,9 +288,9 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
280
288
|
| **Scalability** | Suitable for lightweight tasks and servers | Better for advanced use cases and large-scale rendering |
|
|
281
289
|
| **File Size** | Smaller binary for wkhtmltopdf dependency | Puppeteer requires downloading Chromium (~100MB) |
|
|
282
290
|
|
|
283
|
-
|
|
291
|
+
### Trade-offs
|
|
284
292
|
|
|
285
|
-
|
|
293
|
+
#### p3x-html-pdf (wkhtmltopdf)
|
|
286
294
|
- **Pros:**
|
|
287
295
|
- Lightweight and uses fewer resources.
|
|
288
296
|
- Faster startup time.
|
|
@@ -292,7 +300,7 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
292
300
|
- Limited support for modern web standards and advanced JavaScript.
|
|
293
301
|
- Basic rendering capabilities.
|
|
294
302
|
|
|
295
|
-
|
|
303
|
+
#### Puppeteer
|
|
296
304
|
- **Pros:**
|
|
297
305
|
- Full support for dynamic content, advanced JavaScript, and modern web standards.
|
|
298
306
|
- Highly customizable headers, footers, and PDF options.
|
|
@@ -302,17 +310,17 @@ When deciding between **Puppeteer** and **p3x-html-pdf**, it's essential to unde
|
|
|
302
310
|
- Consumes more CPU and memory.
|
|
303
311
|
- Slower startup time due to launching a full Chrome/Chromium instance.
|
|
304
312
|
|
|
305
|
-
|
|
313
|
+
### When to Use Each
|
|
306
314
|
|
|
307
|
-
|
|
315
|
+
#### Use p3x-html-pdf (wkhtmltopdf):
|
|
308
316
|
- When your content is **static** or doesnβt rely on modern web technologies.
|
|
309
317
|
- When resource efficiency is a priority (e.g., on resource-constrained servers).
|
|
310
318
|
|
|
311
|
-
|
|
319
|
+
#### Use Puppeteer:
|
|
312
320
|
- When your content is **dynamic** or relies heavily on JavaScript and CSS.
|
|
313
321
|
- When rendering accuracy, modern web technology support, or customization is critical.
|
|
314
322
|
|
|
315
|
-
|
|
323
|
+
### Conclusion
|
|
316
324
|
|
|
317
325
|
- **p3x-html-pdf** (wkhtmltopdf) is a better fit for lightweight tasks with simple requirements.
|
|
318
326
|
- **Puppeteer** excels in advanced and dynamic use cases but comes with higher resource costs.
|
|
@@ -366,7 +374,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
|
|
|
366
374
|
---
|
|
367
375
|
|
|
368
376
|
|
|
369
|
-
[**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.
|
|
377
|
+
[**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2025.4.133
|
|
370
378
|
|
|
371
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)
|
|
372
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
|