zhtml2pdf 0.0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1e5b7052064642254d2721980ba63152291e1f1bf7745644bbb3316d88fe5559
4
+ data.tar.gz: 1573f8060aba52f7c6d574b52d6e1250fea41a7b5e0822f66ed30f58d87642af
5
+ SHA512:
6
+ metadata.gz: 1f7a0abcd2082b7de0364bb012cb2ce3f4d3e7abd8fb578309d21e6aa873f74b179ab850ee08d0cd098029a97746a456ff380c472550a81e2f7c85c8fef56ff5
7
+ data.tar.gz: bb5b7e5ba04c5966ccf9f86ff309e0dabc6ea07afe0a99c93d2ca959cb5af2d02eb9bdc1d1d59f4658b89071922f0e060a78203936c709195c10c4cb8402ff16
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+ Version 2, December 2004
3
+
4
+ Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
5
+
6
+ Everyone is permitted to copy and distribute verbatim or modified
7
+ copies of this license document, and changing it is allowed as long
8
+ as the name is changed.
9
+
10
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
+
13
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # `libzhtml2pdf` - WebKit2-based HTML-to-PDF Converter with Simple API
2
+
3
+ `libzhtml2pdf` is a C-based library designed for converting HTML documents into PDF format. This library uses **WebKit2GTK-4.0** as its rendering engine for HTML content, allowing you to create high-quality PDFs from HTML with ease. It offers a simple API that can be integrated into various applications and projects.
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ Before compiling `libzhtml2pdf`, you need to ensure that the following dependencies are installed on your system:
10
+
11
+ ### 1. **WebKit2GTK-4.0**
12
+ - **Version**: `4.0` (or later)
13
+
14
+ ### 2. **Zig Compiler**
15
+ - **Version**: `0.13` (or later)
16
+
17
+ ---
18
+
19
+ ## Building `libzhtml2pdf`
20
+
21
+ Once you have the prerequisites installed, you can proceed to compile `libzhtml2pdf` on your system. Follow these steps:
22
+
23
+ 1. **Clone the Repository**:
24
+
25
+ First, clone the `libzhtml2pdf` repository from GitHub or another source:
26
+ ```bash
27
+ git clone https://github.com/your-repository/libzhtml2pdf.git
28
+ cd libzhtml2pdf
29
+ build zig
30
+ ```
31
+
32
+ After successfully compilation it will produce static library to `zig-out/lib`
33
+
34
+
35
+ ## CAPI Example usage
36
+
37
+ ```c
38
+ #include "zhtml2pdf.h"
39
+
40
+ int main() {
41
+ init_zhtml2pdf();
42
+
43
+ const char* html_content = "<html><body><h1>Sample PDF</h1><p>This is a test PDF generated from HTML.</p></body></html>";
44
+
45
+ unsigned char* pdf_data = NULL;
46
+ int size = zhtml2pdf_convert(html_content);
47
+ if (size < 0) {
48
+ printf("Failed to convert html to pdf!\n");
49
+ return -1;
50
+ }
51
+
52
+ printf("PDF successfully created!\n");
53
+ // Do whatever you want with pdf, output is in base64
54
+
55
+ zhtml2pdf_free(pdf_data);
56
+ deinit_zhtml2pdf();
57
+
58
+ return 0;
59
+ }
60
+
61
+ ```
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ require 'rake'
2
+
3
+ MAKEFILE_PATH = './Makefile'
4
+
5
+ task(:compile) do
6
+ cd 'bindings/ruby/ext/zhtml2pdf' do
7
+ ruby 'extconf.rb'
8
+ sh 'make install'
9
+ end
10
+ end
11
+
12
+ task(build: :compile) do
13
+ sh('gem build zhtml2pdf.gemspec')
14
+ end
@@ -0,0 +1,57 @@
1
+ # `zhtml2pdf` - Ruby bindings for libzhtml2pdf
2
+
3
+ `zhtml2pdf` is a Ruby library that provides bindings to the `libzhtml2pdf` library, which allows you to convert HTML content into a PDF document. This is useful for generating PDFs dynamically from HTML content, making it perfect for use cases like generating reports, invoices, and other documents directly from HTML.
4
+
5
+ ---
6
+
7
+
8
+
9
+ ## Install the Gem
10
+
11
+ Before using the `zhtml2pdf` gem, make sure you have it installed. Download repo and run
12
+
13
+ ```ruby
14
+ rake build
15
+ ```
16
+
17
+ ## Example Usage
18
+
19
+ Below is an example of how to use the `zhtml2pdf` gem to convert an HTML document into a PDF. This demonstrates the basic functionality, from setting up the converter to providing HTML content and converting it into a PDF.
20
+ ```ruby
21
+ require 'zhtml2pdf'
22
+
23
+ converter = ZHtml2Pdf::Converter.new
24
+
25
+ # Sample HTML content to convert. This could be a string of HTML or a file reference.
26
+ # `file:///path/to/your/file.html`
27
+ html_text = "data:text/html;charset=utf-8,<!DOCTYPE html>
28
+ <html lang='en'>
29
+ <head>
30
+ <meta charset='UTF-8'>
31
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
32
+ <title>Sample PDF Content</title>
33
+ <style>
34
+ body { font-family: Arial, sans-serif; margin: 20px; }
35
+ h1 { color: #333366; }
36
+ p { font-size: 14px; color: #555555; }
37
+ .container { border: 1px solid #ddd; padding: 15px; border-radius: 5px; }
38
+ </style>
39
+ </head>
40
+ <body>
41
+ <div class='container'>
42
+ <h1>PDF Generation Test</h1>
43
+ <p>This is a sample HTML document for testing PDF conversion.</p>
44
+ <ul>
45
+ <li>Item 1</li>
46
+ <li>Item 2</li>
47
+ <li>Item 3</li>
48
+ </ul>
49
+ </div>
50
+ </body>
51
+ </html>"
52
+
53
+ # Second argument is webkit settings string in .ini format.
54
+ # Last argument is default_css.
55
+ content = converter.convert(html_text, nil, nil)
56
+ puts content
57
+ ```
@@ -0,0 +1,15 @@
1
+ all:
2
+ RUBY_LIBDIR=/home/lsd/.rbenv/versions/3.1.2/lib RUBY_HDRDIR=/home/lsd/.rbenv/versions/3.1.2/include/ruby-3.1.0 RUBY_ARCHHDRDIR=/home/lsd/.rbenv/versions/3.1.2/include/ruby-3.1.0/x86_64-linux zig build -Doptimize=ReleaseFast -p ./build
3
+ sh -c 'if [ -d '/home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/.zig-cache' ]; then rm -r '/home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/.zig-cache'; fi'
4
+ sh -c 'if [ -d 'zig-out' ]; then rm -r 'zig-out'; fi'
5
+
6
+ install: all
7
+ cp /home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/build/lib/libzhtml2pdf.so ../../lib/zhtml2pdf.so
8
+ sh -c 'if [ -d 'build' ]; then rm -r 'build'; fi'
9
+
10
+ clean:
11
+ rm -rf build /home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/build/lib/libzhtml2pdf.so
12
+ sh -c 'if [ -d '/home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/.zig-cache' ]; then rm -r '/home/lsd/zhtml2pdf2/bindings/ruby/ext/zhtml2pdf/.zig-cache'; fi'
13
+ sh -c 'if [ -d 'zig-out' ]; then rm -r 'zig-out'; fi'
14
+ sh -c 'if [ -d 'build' ]; then rm -r 'build'; fi'
15
+
@@ -0,0 +1,34 @@
1
+ const std = @import("std");
2
+
3
+ pub fn build(b: *std.Build) void {
4
+ const target = b.standardTargetOptions(.{});
5
+ const optimize = b.standardOptimizeOption(.{});
6
+
7
+ const lib = b.addSharedLibrary(
8
+ .{
9
+ .name = "zhtml2pdf",
10
+ .root_source_file = b.path("src/main.zig"),
11
+ .version = .{ .major = 0, .minor = 0, .patch = 1 },
12
+ .optimize = optimize,
13
+ .target = target,
14
+ },
15
+ );
16
+
17
+ const ruby_libdir = std.posix.getenv("RUBY_LIBDIR") orelse "";
18
+ lib.addIncludePath(std.Build.LazyPath{ .cwd_relative = ruby_libdir });
19
+ const ruby_hdrdir = std.posix.getenv("RUBY_HDRDIR") orelse "";
20
+ lib.addIncludePath(std.Build.LazyPath{ .cwd_relative = ruby_hdrdir });
21
+ const ruby_archhdrdir = std.posix.getenv("RUBY_ARCHHDRDIR") orelse "";
22
+ lib.addIncludePath(std.Build.LazyPath{ .cwd_relative = ruby_archhdrdir });
23
+
24
+ lib.addCSourceFile(.{
25
+ .file = b.path("../../../../src/zhtml2pdf.c"),
26
+ });
27
+
28
+ lib.linkSystemLibrary("webkit2gtk-4.0");
29
+ lib.linkSystemLibrary("glib-2.0");
30
+
31
+ lib.linkLibC();
32
+
33
+ b.installArtifact(lib);
34
+ }
@@ -0,0 +1,26 @@
1
+ require 'mkmf'
2
+
3
+ so_name = 'zhtml2pdf'
4
+ target_path = File.join(Dir.pwd, 'build', 'lib', 'libzhtml2pdf.so')
5
+ cache_path = File.join(Dir.pwd, '.zig-cache')
6
+ config = RbConfig::CONFIG
7
+
8
+ File.open('Makefile', 'w') do |f|
9
+ f.puts <<~MAKEFILE
10
+ all:
11
+ \tRUBY_LIBDIR=#{config['libdir']} RUBY_HDRDIR=#{config['rubyhdrdir']} RUBY_ARCHHDRDIR=#{config['rubyarchhdrdir']} zig build -Doptimize=ReleaseFast -p ./build
12
+ \tsh -c 'if [ -d '#{cache_path}' ]; then rm -r '#{cache_path}'; fi'
13
+ \tsh -c 'if [ -d 'zig-out' ]; then rm -r 'zig-out'; fi'
14
+
15
+ install: all
16
+ \tcp #{target_path} ../../lib/#{so_name}.so
17
+ \tsh -c 'if [ -d 'build' ]; then rm -r 'build'; fi'
18
+
19
+ clean:
20
+ \trm -rf build #{target_path}
21
+ \tsh -c 'if [ -d '#{cache_path}' ]; then rm -r '#{cache_path}'; fi'
22
+ \tsh -c 'if [ -d 'zig-out' ]; then rm -r 'zig-out'; fi'
23
+ \tsh -c 'if [ -d 'build' ]; then rm -r 'build'; fi'
24
+
25
+ MAKEFILE
26
+ end
@@ -0,0 +1,59 @@
1
+ const std = @import("std");
2
+ const builtin = @import("builtin");
3
+ const ruby = @cImport(@cInclude("ruby/ruby.h"));
4
+ const zhtml2pdf = @import("zhtml2pdf.zig");
5
+
6
+ fn rb_converter_init(...) callconv(.C) ruby.VALUE {
7
+ var ap: std.builtin.VaList = @cVaStart();
8
+ defer @cVaEnd(&ap);
9
+
10
+ zhtml2pdf.init_zhtml2pdf();
11
+
12
+ return @cVaArg(&ap, ruby.VALUE);
13
+ }
14
+
15
+ fn rb_converter_finalize(_: ruby.VALUE, _: ruby.VALUE, _: c_int, _: [*c]const ruby.VALUE, _: ruby.VALUE) callconv(.C) ruby.VALUE {
16
+ zhtml2pdf.deinit_zhtml2pdf();
17
+ return ruby.Qnil;
18
+ }
19
+
20
+ fn value2cstring(value: ruby.VALUE) [*c]u8 {
21
+ if (ruby.TYPE(value) == ruby.T_STRING) {
22
+ const v: [*c]volatile ruby.VALUE = @constCast(@ptrCast(&value));
23
+ return ruby.rb_string_value_cstr(v);
24
+ }
25
+ return @constCast(@ptrCast(""));
26
+ }
27
+
28
+ fn rb_converter_convert(...) callconv(.C) ruby.VALUE {
29
+ var ap: std.builtin.VaList = @cVaStart();
30
+ defer @cVaEnd(&ap);
31
+
32
+ const self: ruby.VALUE = @cVaArg(&ap, ruby.VALUE);
33
+ _ = self;
34
+
35
+ const input: [*c]u8 = value2cstring(@cVaArg(&ap, ruby.VALUE));
36
+ const settings: [*c]u8 = value2cstring(@cVaArg(&ap, ruby.VALUE));
37
+ const css: [*c]u8 = value2cstring(@cVaArg(&ap, ruby.VALUE));
38
+
39
+ var content: [*c]u8 = undefined;
40
+ const size: c_int = zhtml2pdf.zhtml2pdf(input, settings, css, &content);
41
+ if (size <= 0) return ruby.INT2NUM(size);
42
+
43
+ const rstring: ruby.VALUE = ruby.rb_str_new(content, size);
44
+
45
+ zhtml2pdf.zhtml2pdf_free(@ptrCast(&content));
46
+
47
+ return rstring;
48
+ }
49
+
50
+ export fn Init_zhtml2pdf() void {
51
+ const zhtml2pdf_mod: ruby.VALUE = ruby.rb_define_module("ZHtml2Pdf");
52
+ const converter_klass: ruby.VALUE = ruby.rb_define_class_under(zhtml2pdf_mod, "Converter", ruby.rb_cObject);
53
+
54
+ _ = ruby.rb_define_method(converter_klass, "convert", rb_converter_convert, 3);
55
+ _ = ruby.rb_define_method(converter_klass, "initialize", rb_converter_init, 0);
56
+
57
+ const proc: ruby.VALUE = ruby.rb_proc_new(rb_converter_finalize, ruby.Qnil);
58
+ _ = ruby.rb_define_finalizer(converter_klass, proc);
59
+ }
@@ -0,0 +1,503 @@
1
+ pub const __builtin_bswap16 = @import("std").zig.c_builtins.__builtin_bswap16;
2
+ pub const __builtin_bswap32 = @import("std").zig.c_builtins.__builtin_bswap32;
3
+ pub const __builtin_bswap64 = @import("std").zig.c_builtins.__builtin_bswap64;
4
+ pub const __builtin_signbit = @import("std").zig.c_builtins.__builtin_signbit;
5
+ pub const __builtin_signbitf = @import("std").zig.c_builtins.__builtin_signbitf;
6
+ pub const __builtin_popcount = @import("std").zig.c_builtins.__builtin_popcount;
7
+ pub const __builtin_ctz = @import("std").zig.c_builtins.__builtin_ctz;
8
+ pub const __builtin_clz = @import("std").zig.c_builtins.__builtin_clz;
9
+ pub const __builtin_sqrt = @import("std").zig.c_builtins.__builtin_sqrt;
10
+ pub const __builtin_sqrtf = @import("std").zig.c_builtins.__builtin_sqrtf;
11
+ pub const __builtin_sin = @import("std").zig.c_builtins.__builtin_sin;
12
+ pub const __builtin_sinf = @import("std").zig.c_builtins.__builtin_sinf;
13
+ pub const __builtin_cos = @import("std").zig.c_builtins.__builtin_cos;
14
+ pub const __builtin_cosf = @import("std").zig.c_builtins.__builtin_cosf;
15
+ pub const __builtin_exp = @import("std").zig.c_builtins.__builtin_exp;
16
+ pub const __builtin_expf = @import("std").zig.c_builtins.__builtin_expf;
17
+ pub const __builtin_exp2 = @import("std").zig.c_builtins.__builtin_exp2;
18
+ pub const __builtin_exp2f = @import("std").zig.c_builtins.__builtin_exp2f;
19
+ pub const __builtin_log = @import("std").zig.c_builtins.__builtin_log;
20
+ pub const __builtin_logf = @import("std").zig.c_builtins.__builtin_logf;
21
+ pub const __builtin_log2 = @import("std").zig.c_builtins.__builtin_log2;
22
+ pub const __builtin_log2f = @import("std").zig.c_builtins.__builtin_log2f;
23
+ pub const __builtin_log10 = @import("std").zig.c_builtins.__builtin_log10;
24
+ pub const __builtin_log10f = @import("std").zig.c_builtins.__builtin_log10f;
25
+ pub const __builtin_abs = @import("std").zig.c_builtins.__builtin_abs;
26
+ pub const __builtin_labs = @import("std").zig.c_builtins.__builtin_labs;
27
+ pub const __builtin_llabs = @import("std").zig.c_builtins.__builtin_llabs;
28
+ pub const __builtin_fabs = @import("std").zig.c_builtins.__builtin_fabs;
29
+ pub const __builtin_fabsf = @import("std").zig.c_builtins.__builtin_fabsf;
30
+ pub const __builtin_floor = @import("std").zig.c_builtins.__builtin_floor;
31
+ pub const __builtin_floorf = @import("std").zig.c_builtins.__builtin_floorf;
32
+ pub const __builtin_ceil = @import("std").zig.c_builtins.__builtin_ceil;
33
+ pub const __builtin_ceilf = @import("std").zig.c_builtins.__builtin_ceilf;
34
+ pub const __builtin_trunc = @import("std").zig.c_builtins.__builtin_trunc;
35
+ pub const __builtin_truncf = @import("std").zig.c_builtins.__builtin_truncf;
36
+ pub const __builtin_round = @import("std").zig.c_builtins.__builtin_round;
37
+ pub const __builtin_roundf = @import("std").zig.c_builtins.__builtin_roundf;
38
+ pub const __builtin_strlen = @import("std").zig.c_builtins.__builtin_strlen;
39
+ pub const __builtin_strcmp = @import("std").zig.c_builtins.__builtin_strcmp;
40
+ pub const __builtin_object_size = @import("std").zig.c_builtins.__builtin_object_size;
41
+ pub const __builtin___memset_chk = @import("std").zig.c_builtins.__builtin___memset_chk;
42
+ pub const __builtin_memset = @import("std").zig.c_builtins.__builtin_memset;
43
+ pub const __builtin___memcpy_chk = @import("std").zig.c_builtins.__builtin___memcpy_chk;
44
+ pub const __builtin_memcpy = @import("std").zig.c_builtins.__builtin_memcpy;
45
+ pub const __builtin_expect = @import("std").zig.c_builtins.__builtin_expect;
46
+ pub const __builtin_nanf = @import("std").zig.c_builtins.__builtin_nanf;
47
+ pub const __builtin_huge_valf = @import("std").zig.c_builtins.__builtin_huge_valf;
48
+ pub const __builtin_inff = @import("std").zig.c_builtins.__builtin_inff;
49
+ pub const __builtin_isnan = @import("std").zig.c_builtins.__builtin_isnan;
50
+ pub const __builtin_isinf = @import("std").zig.c_builtins.__builtin_isinf;
51
+ pub const __builtin_isinf_sign = @import("std").zig.c_builtins.__builtin_isinf_sign;
52
+ pub const __has_builtin = @import("std").zig.c_builtins.__has_builtin;
53
+ pub const __builtin_assume = @import("std").zig.c_builtins.__builtin_assume;
54
+ pub const __builtin_unreachable = @import("std").zig.c_builtins.__builtin_unreachable;
55
+ pub const __builtin_constant_p = @import("std").zig.c_builtins.__builtin_constant_p;
56
+ pub const __builtin_mul_overflow = @import("std").zig.c_builtins.__builtin_mul_overflow;
57
+ pub extern fn init_zhtml2pdf(...) void;
58
+ pub extern fn deinit_zhtml2pdf(...) void;
59
+ pub extern fn zhtml2pdf(
60
+ input: [*c]const u8,
61
+ settings: [*c]const u8,
62
+ css: [*c]const u8,
63
+ output: *[*c]u8,
64
+ ) c_int;
65
+ pub extern fn zhtml2pdf_free(buffer: *anyopaque) void;
66
+ pub extern fn init_loop_zhtml2pdf(...) void;
67
+ pub extern fn deinit_loop_zhtml2pdf(...) void;
68
+ pub const __llvm__ = @as(c_int, 1);
69
+ pub const __clang__ = @as(c_int, 1);
70
+ pub const __clang_major__ = @as(c_int, 18);
71
+ pub const __clang_minor__ = @as(c_int, 1);
72
+ pub const __clang_patchlevel__ = @as(c_int, 6);
73
+ pub const __clang_version__ = "18.1.6 (https://github.com/ziglang/zig-bootstrap 98bc6bf4fc4009888d33941daf6b600d20a42a56)";
74
+ pub const __GNUC__ = @as(c_int, 4);
75
+ pub const __GNUC_MINOR__ = @as(c_int, 2);
76
+ pub const __GNUC_PATCHLEVEL__ = @as(c_int, 1);
77
+ pub const __GXX_ABI_VERSION = @as(c_int, 1002);
78
+ pub const __ATOMIC_RELAXED = @as(c_int, 0);
79
+ pub const __ATOMIC_CONSUME = @as(c_int, 1);
80
+ pub const __ATOMIC_ACQUIRE = @as(c_int, 2);
81
+ pub const __ATOMIC_RELEASE = @as(c_int, 3);
82
+ pub const __ATOMIC_ACQ_REL = @as(c_int, 4);
83
+ pub const __ATOMIC_SEQ_CST = @as(c_int, 5);
84
+ pub const __MEMORY_SCOPE_SYSTEM = @as(c_int, 0);
85
+ pub const __MEMORY_SCOPE_DEVICE = @as(c_int, 1);
86
+ pub const __MEMORY_SCOPE_WRKGRP = @as(c_int, 2);
87
+ pub const __MEMORY_SCOPE_WVFRNT = @as(c_int, 3);
88
+ pub const __MEMORY_SCOPE_SINGLE = @as(c_int, 4);
89
+ pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM = @as(c_int, 0);
90
+ pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP = @as(c_int, 1);
91
+ pub const __OPENCL_MEMORY_SCOPE_DEVICE = @as(c_int, 2);
92
+ pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES = @as(c_int, 3);
93
+ pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP = @as(c_int, 4);
94
+ pub const __FPCLASS_SNAN = @as(c_int, 0x0001);
95
+ pub const __FPCLASS_QNAN = @as(c_int, 0x0002);
96
+ pub const __FPCLASS_NEGINF = @as(c_int, 0x0004);
97
+ pub const __FPCLASS_NEGNORMAL = @as(c_int, 0x0008);
98
+ pub const __FPCLASS_NEGSUBNORMAL = @as(c_int, 0x0010);
99
+ pub const __FPCLASS_NEGZERO = @as(c_int, 0x0020);
100
+ pub const __FPCLASS_POSZERO = @as(c_int, 0x0040);
101
+ pub const __FPCLASS_POSSUBNORMAL = @as(c_int, 0x0080);
102
+ pub const __FPCLASS_POSNORMAL = @as(c_int, 0x0100);
103
+ pub const __FPCLASS_POSINF = @as(c_int, 0x0200);
104
+ pub const __PRAGMA_REDEFINE_EXTNAME = @as(c_int, 1);
105
+ pub const __VERSION__ = "Clang 18.1.6 (https://github.com/ziglang/zig-bootstrap 98bc6bf4fc4009888d33941daf6b600d20a42a56)";
106
+ pub const __OBJC_BOOL_IS_BOOL = @as(c_int, 0);
107
+ pub const __CONSTANT_CFSTRINGS__ = @as(c_int, 1);
108
+ pub const __clang_literal_encoding__ = "UTF-8";
109
+ pub const __clang_wide_literal_encoding__ = "UTF-32";
110
+ pub const __ORDER_LITTLE_ENDIAN__ = @as(c_int, 1234);
111
+ pub const __ORDER_BIG_ENDIAN__ = @as(c_int, 4321);
112
+ pub const __ORDER_PDP_ENDIAN__ = @as(c_int, 3412);
113
+ pub const __BYTE_ORDER__ = __ORDER_LITTLE_ENDIAN__;
114
+ pub const __LITTLE_ENDIAN__ = @as(c_int, 1);
115
+ pub const _LP64 = @as(c_int, 1);
116
+ pub const __LP64__ = @as(c_int, 1);
117
+ pub const __CHAR_BIT__ = @as(c_int, 8);
118
+ pub const __BOOL_WIDTH__ = @as(c_int, 8);
119
+ pub const __SHRT_WIDTH__ = @as(c_int, 16);
120
+ pub const __INT_WIDTH__ = @as(c_int, 32);
121
+ pub const __LONG_WIDTH__ = @as(c_int, 64);
122
+ pub const __LLONG_WIDTH__ = @as(c_int, 64);
123
+ pub const __BITINT_MAXWIDTH__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 8388608, .decimal);
124
+ pub const __SCHAR_MAX__ = @as(c_int, 127);
125
+ pub const __SHRT_MAX__ = @as(c_int, 32767);
126
+ pub const __INT_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
127
+ pub const __LONG_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
128
+ pub const __LONG_LONG_MAX__ = @as(c_longlong, 9223372036854775807);
129
+ pub const __WCHAR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
130
+ pub const __WCHAR_WIDTH__ = @as(c_int, 32);
131
+ pub const __WINT_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal);
132
+ pub const __WINT_WIDTH__ = @as(c_int, 32);
133
+ pub const __INTMAX_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
134
+ pub const __INTMAX_WIDTH__ = @as(c_int, 64);
135
+ pub const __SIZE_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
136
+ pub const __SIZE_WIDTH__ = @as(c_int, 64);
137
+ pub const __UINTMAX_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
138
+ pub const __UINTMAX_WIDTH__ = @as(c_int, 64);
139
+ pub const __PTRDIFF_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
140
+ pub const __PTRDIFF_WIDTH__ = @as(c_int, 64);
141
+ pub const __INTPTR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
142
+ pub const __INTPTR_WIDTH__ = @as(c_int, 64);
143
+ pub const __UINTPTR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
144
+ pub const __UINTPTR_WIDTH__ = @as(c_int, 64);
145
+ pub const __SIZEOF_DOUBLE__ = @as(c_int, 8);
146
+ pub const __SIZEOF_FLOAT__ = @as(c_int, 4);
147
+ pub const __SIZEOF_INT__ = @as(c_int, 4);
148
+ pub const __SIZEOF_LONG__ = @as(c_int, 8);
149
+ pub const __SIZEOF_LONG_DOUBLE__ = @as(c_int, 16);
150
+ pub const __SIZEOF_LONG_LONG__ = @as(c_int, 8);
151
+ pub const __SIZEOF_POINTER__ = @as(c_int, 8);
152
+ pub const __SIZEOF_SHORT__ = @as(c_int, 2);
153
+ pub const __SIZEOF_PTRDIFF_T__ = @as(c_int, 8);
154
+ pub const __SIZEOF_SIZE_T__ = @as(c_int, 8);
155
+ pub const __SIZEOF_WCHAR_T__ = @as(c_int, 4);
156
+ pub const __SIZEOF_WINT_T__ = @as(c_int, 4);
157
+ pub const __SIZEOF_INT128__ = @as(c_int, 16);
158
+ pub const __INTMAX_TYPE__ = c_long;
159
+ pub const __INTMAX_FMTd__ = "ld";
160
+ pub const __INTMAX_FMTi__ = "li";
161
+ pub const __INTMAX_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `L`");
162
+ // (no file):95:9
163
+ pub const __UINTMAX_TYPE__ = c_ulong;
164
+ pub const __UINTMAX_FMTo__ = "lo";
165
+ pub const __UINTMAX_FMTu__ = "lu";
166
+ pub const __UINTMAX_FMTx__ = "lx";
167
+ pub const __UINTMAX_FMTX__ = "lX";
168
+ pub const __UINTMAX_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `UL`");
169
+ // (no file):101:9
170
+ pub const __PTRDIFF_TYPE__ = c_long;
171
+ pub const __PTRDIFF_FMTd__ = "ld";
172
+ pub const __PTRDIFF_FMTi__ = "li";
173
+ pub const __INTPTR_TYPE__ = c_long;
174
+ pub const __INTPTR_FMTd__ = "ld";
175
+ pub const __INTPTR_FMTi__ = "li";
176
+ pub const __SIZE_TYPE__ = c_ulong;
177
+ pub const __SIZE_FMTo__ = "lo";
178
+ pub const __SIZE_FMTu__ = "lu";
179
+ pub const __SIZE_FMTx__ = "lx";
180
+ pub const __SIZE_FMTX__ = "lX";
181
+ pub const __WCHAR_TYPE__ = c_int;
182
+ pub const __WINT_TYPE__ = c_uint;
183
+ pub const __SIG_ATOMIC_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
184
+ pub const __SIG_ATOMIC_WIDTH__ = @as(c_int, 32);
185
+ pub const __CHAR16_TYPE__ = c_ushort;
186
+ pub const __CHAR32_TYPE__ = c_uint;
187
+ pub const __UINTPTR_TYPE__ = c_ulong;
188
+ pub const __UINTPTR_FMTo__ = "lo";
189
+ pub const __UINTPTR_FMTu__ = "lu";
190
+ pub const __UINTPTR_FMTx__ = "lx";
191
+ pub const __UINTPTR_FMTX__ = "lX";
192
+ pub const __FLT16_DENORM_MIN__ = @as(f16, 5.9604644775390625e-8);
193
+ pub const __FLT16_HAS_DENORM__ = @as(c_int, 1);
194
+ pub const __FLT16_DIG__ = @as(c_int, 3);
195
+ pub const __FLT16_DECIMAL_DIG__ = @as(c_int, 5);
196
+ pub const __FLT16_EPSILON__ = @as(f16, 9.765625e-4);
197
+ pub const __FLT16_HAS_INFINITY__ = @as(c_int, 1);
198
+ pub const __FLT16_HAS_QUIET_NAN__ = @as(c_int, 1);
199
+ pub const __FLT16_MANT_DIG__ = @as(c_int, 11);
200
+ pub const __FLT16_MAX_10_EXP__ = @as(c_int, 4);
201
+ pub const __FLT16_MAX_EXP__ = @as(c_int, 16);
202
+ pub const __FLT16_MAX__ = @as(f16, 6.5504e+4);
203
+ pub const __FLT16_MIN_10_EXP__ = -@as(c_int, 4);
204
+ pub const __FLT16_MIN_EXP__ = -@as(c_int, 13);
205
+ pub const __FLT16_MIN__ = @as(f16, 6.103515625e-5);
206
+ pub const __FLT_DENORM_MIN__ = @as(f32, 1.40129846e-45);
207
+ pub const __FLT_HAS_DENORM__ = @as(c_int, 1);
208
+ pub const __FLT_DIG__ = @as(c_int, 6);
209
+ pub const __FLT_DECIMAL_DIG__ = @as(c_int, 9);
210
+ pub const __FLT_EPSILON__ = @as(f32, 1.19209290e-7);
211
+ pub const __FLT_HAS_INFINITY__ = @as(c_int, 1);
212
+ pub const __FLT_HAS_QUIET_NAN__ = @as(c_int, 1);
213
+ pub const __FLT_MANT_DIG__ = @as(c_int, 24);
214
+ pub const __FLT_MAX_10_EXP__ = @as(c_int, 38);
215
+ pub const __FLT_MAX_EXP__ = @as(c_int, 128);
216
+ pub const __FLT_MAX__ = @as(f32, 3.40282347e+38);
217
+ pub const __FLT_MIN_10_EXP__ = -@as(c_int, 37);
218
+ pub const __FLT_MIN_EXP__ = -@as(c_int, 125);
219
+ pub const __FLT_MIN__ = @as(f32, 1.17549435e-38);
220
+ pub const __DBL_DENORM_MIN__ = @as(f64, 4.9406564584124654e-324);
221
+ pub const __DBL_HAS_DENORM__ = @as(c_int, 1);
222
+ pub const __DBL_DIG__ = @as(c_int, 15);
223
+ pub const __DBL_DECIMAL_DIG__ = @as(c_int, 17);
224
+ pub const __DBL_EPSILON__ = @as(f64, 2.2204460492503131e-16);
225
+ pub const __DBL_HAS_INFINITY__ = @as(c_int, 1);
226
+ pub const __DBL_HAS_QUIET_NAN__ = @as(c_int, 1);
227
+ pub const __DBL_MANT_DIG__ = @as(c_int, 53);
228
+ pub const __DBL_MAX_10_EXP__ = @as(c_int, 308);
229
+ pub const __DBL_MAX_EXP__ = @as(c_int, 1024);
230
+ pub const __DBL_MAX__ = @as(f64, 1.7976931348623157e+308);
231
+ pub const __DBL_MIN_10_EXP__ = -@as(c_int, 307);
232
+ pub const __DBL_MIN_EXP__ = -@as(c_int, 1021);
233
+ pub const __DBL_MIN__ = @as(f64, 2.2250738585072014e-308);
234
+ pub const __LDBL_DENORM_MIN__ = @as(c_longdouble, 3.64519953188247460253e-4951);
235
+ pub const __LDBL_HAS_DENORM__ = @as(c_int, 1);
236
+ pub const __LDBL_DIG__ = @as(c_int, 18);
237
+ pub const __LDBL_DECIMAL_DIG__ = @as(c_int, 21);
238
+ pub const __LDBL_EPSILON__ = @as(c_longdouble, 1.08420217248550443401e-19);
239
+ pub const __LDBL_HAS_INFINITY__ = @as(c_int, 1);
240
+ pub const __LDBL_HAS_QUIET_NAN__ = @as(c_int, 1);
241
+ pub const __LDBL_MANT_DIG__ = @as(c_int, 64);
242
+ pub const __LDBL_MAX_10_EXP__ = @as(c_int, 4932);
243
+ pub const __LDBL_MAX_EXP__ = @as(c_int, 16384);
244
+ pub const __LDBL_MAX__ = @as(c_longdouble, 1.18973149535723176502e+4932);
245
+ pub const __LDBL_MIN_10_EXP__ = -@as(c_int, 4931);
246
+ pub const __LDBL_MIN_EXP__ = -@as(c_int, 16381);
247
+ pub const __LDBL_MIN__ = @as(c_longdouble, 3.36210314311209350626e-4932);
248
+ pub const __POINTER_WIDTH__ = @as(c_int, 64);
249
+ pub const __BIGGEST_ALIGNMENT__ = @as(c_int, 16);
250
+ pub const __WINT_UNSIGNED__ = @as(c_int, 1);
251
+ pub const __INT8_TYPE__ = i8;
252
+ pub const __INT8_FMTd__ = "hhd";
253
+ pub const __INT8_FMTi__ = "hhi";
254
+ pub const __INT8_C_SUFFIX__ = "";
255
+ pub const __INT16_TYPE__ = c_short;
256
+ pub const __INT16_FMTd__ = "hd";
257
+ pub const __INT16_FMTi__ = "hi";
258
+ pub const __INT16_C_SUFFIX__ = "";
259
+ pub const __INT32_TYPE__ = c_int;
260
+ pub const __INT32_FMTd__ = "d";
261
+ pub const __INT32_FMTi__ = "i";
262
+ pub const __INT32_C_SUFFIX__ = "";
263
+ pub const __INT64_TYPE__ = c_long;
264
+ pub const __INT64_FMTd__ = "ld";
265
+ pub const __INT64_FMTi__ = "li";
266
+ pub const __INT64_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `L`");
267
+ // (no file):198:9
268
+ pub const __UINT8_TYPE__ = u8;
269
+ pub const __UINT8_FMTo__ = "hho";
270
+ pub const __UINT8_FMTu__ = "hhu";
271
+ pub const __UINT8_FMTx__ = "hhx";
272
+ pub const __UINT8_FMTX__ = "hhX";
273
+ pub const __UINT8_C_SUFFIX__ = "";
274
+ pub const __UINT8_MAX__ = @as(c_int, 255);
275
+ pub const __INT8_MAX__ = @as(c_int, 127);
276
+ pub const __UINT16_TYPE__ = c_ushort;
277
+ pub const __UINT16_FMTo__ = "ho";
278
+ pub const __UINT16_FMTu__ = "hu";
279
+ pub const __UINT16_FMTx__ = "hx";
280
+ pub const __UINT16_FMTX__ = "hX";
281
+ pub const __UINT16_C_SUFFIX__ = "";
282
+ pub const __UINT16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal);
283
+ pub const __INT16_MAX__ = @as(c_int, 32767);
284
+ pub const __UINT32_TYPE__ = c_uint;
285
+ pub const __UINT32_FMTo__ = "o";
286
+ pub const __UINT32_FMTu__ = "u";
287
+ pub const __UINT32_FMTx__ = "x";
288
+ pub const __UINT32_FMTX__ = "X";
289
+ pub const __UINT32_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `U`");
290
+ // (no file):220:9
291
+ pub const __UINT32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal);
292
+ pub const __INT32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
293
+ pub const __UINT64_TYPE__ = c_ulong;
294
+ pub const __UINT64_FMTo__ = "lo";
295
+ pub const __UINT64_FMTu__ = "lu";
296
+ pub const __UINT64_FMTx__ = "lx";
297
+ pub const __UINT64_FMTX__ = "lX";
298
+ pub const __UINT64_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `UL`");
299
+ // (no file):228:9
300
+ pub const __UINT64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
301
+ pub const __INT64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
302
+ pub const __INT_LEAST8_TYPE__ = i8;
303
+ pub const __INT_LEAST8_MAX__ = @as(c_int, 127);
304
+ pub const __INT_LEAST8_WIDTH__ = @as(c_int, 8);
305
+ pub const __INT_LEAST8_FMTd__ = "hhd";
306
+ pub const __INT_LEAST8_FMTi__ = "hhi";
307
+ pub const __UINT_LEAST8_TYPE__ = u8;
308
+ pub const __UINT_LEAST8_MAX__ = @as(c_int, 255);
309
+ pub const __UINT_LEAST8_FMTo__ = "hho";
310
+ pub const __UINT_LEAST8_FMTu__ = "hhu";
311
+ pub const __UINT_LEAST8_FMTx__ = "hhx";
312
+ pub const __UINT_LEAST8_FMTX__ = "hhX";
313
+ pub const __INT_LEAST16_TYPE__ = c_short;
314
+ pub const __INT_LEAST16_MAX__ = @as(c_int, 32767);
315
+ pub const __INT_LEAST16_WIDTH__ = @as(c_int, 16);
316
+ pub const __INT_LEAST16_FMTd__ = "hd";
317
+ pub const __INT_LEAST16_FMTi__ = "hi";
318
+ pub const __UINT_LEAST16_TYPE__ = c_ushort;
319
+ pub const __UINT_LEAST16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal);
320
+ pub const __UINT_LEAST16_FMTo__ = "ho";
321
+ pub const __UINT_LEAST16_FMTu__ = "hu";
322
+ pub const __UINT_LEAST16_FMTx__ = "hx";
323
+ pub const __UINT_LEAST16_FMTX__ = "hX";
324
+ pub const __INT_LEAST32_TYPE__ = c_int;
325
+ pub const __INT_LEAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
326
+ pub const __INT_LEAST32_WIDTH__ = @as(c_int, 32);
327
+ pub const __INT_LEAST32_FMTd__ = "d";
328
+ pub const __INT_LEAST32_FMTi__ = "i";
329
+ pub const __UINT_LEAST32_TYPE__ = c_uint;
330
+ pub const __UINT_LEAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal);
331
+ pub const __UINT_LEAST32_FMTo__ = "o";
332
+ pub const __UINT_LEAST32_FMTu__ = "u";
333
+ pub const __UINT_LEAST32_FMTx__ = "x";
334
+ pub const __UINT_LEAST32_FMTX__ = "X";
335
+ pub const __INT_LEAST64_TYPE__ = c_long;
336
+ pub const __INT_LEAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
337
+ pub const __INT_LEAST64_WIDTH__ = @as(c_int, 64);
338
+ pub const __INT_LEAST64_FMTd__ = "ld";
339
+ pub const __INT_LEAST64_FMTi__ = "li";
340
+ pub const __UINT_LEAST64_TYPE__ = c_ulong;
341
+ pub const __UINT_LEAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
342
+ pub const __UINT_LEAST64_FMTo__ = "lo";
343
+ pub const __UINT_LEAST64_FMTu__ = "lu";
344
+ pub const __UINT_LEAST64_FMTx__ = "lx";
345
+ pub const __UINT_LEAST64_FMTX__ = "lX";
346
+ pub const __INT_FAST8_TYPE__ = i8;
347
+ pub const __INT_FAST8_MAX__ = @as(c_int, 127);
348
+ pub const __INT_FAST8_WIDTH__ = @as(c_int, 8);
349
+ pub const __INT_FAST8_FMTd__ = "hhd";
350
+ pub const __INT_FAST8_FMTi__ = "hhi";
351
+ pub const __UINT_FAST8_TYPE__ = u8;
352
+ pub const __UINT_FAST8_MAX__ = @as(c_int, 255);
353
+ pub const __UINT_FAST8_FMTo__ = "hho";
354
+ pub const __UINT_FAST8_FMTu__ = "hhu";
355
+ pub const __UINT_FAST8_FMTx__ = "hhx";
356
+ pub const __UINT_FAST8_FMTX__ = "hhX";
357
+ pub const __INT_FAST16_TYPE__ = c_short;
358
+ pub const __INT_FAST16_MAX__ = @as(c_int, 32767);
359
+ pub const __INT_FAST16_WIDTH__ = @as(c_int, 16);
360
+ pub const __INT_FAST16_FMTd__ = "hd";
361
+ pub const __INT_FAST16_FMTi__ = "hi";
362
+ pub const __UINT_FAST16_TYPE__ = c_ushort;
363
+ pub const __UINT_FAST16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal);
364
+ pub const __UINT_FAST16_FMTo__ = "ho";
365
+ pub const __UINT_FAST16_FMTu__ = "hu";
366
+ pub const __UINT_FAST16_FMTx__ = "hx";
367
+ pub const __UINT_FAST16_FMTX__ = "hX";
368
+ pub const __INT_FAST32_TYPE__ = c_int;
369
+ pub const __INT_FAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal);
370
+ pub const __INT_FAST32_WIDTH__ = @as(c_int, 32);
371
+ pub const __INT_FAST32_FMTd__ = "d";
372
+ pub const __INT_FAST32_FMTi__ = "i";
373
+ pub const __UINT_FAST32_TYPE__ = c_uint;
374
+ pub const __UINT_FAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal);
375
+ pub const __UINT_FAST32_FMTo__ = "o";
376
+ pub const __UINT_FAST32_FMTu__ = "u";
377
+ pub const __UINT_FAST32_FMTx__ = "x";
378
+ pub const __UINT_FAST32_FMTX__ = "X";
379
+ pub const __INT_FAST64_TYPE__ = c_long;
380
+ pub const __INT_FAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal);
381
+ pub const __INT_FAST64_WIDTH__ = @as(c_int, 64);
382
+ pub const __INT_FAST64_FMTd__ = "ld";
383
+ pub const __INT_FAST64_FMTi__ = "li";
384
+ pub const __UINT_FAST64_TYPE__ = c_ulong;
385
+ pub const __UINT_FAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal);
386
+ pub const __UINT_FAST64_FMTo__ = "lo";
387
+ pub const __UINT_FAST64_FMTu__ = "lu";
388
+ pub const __UINT_FAST64_FMTx__ = "lx";
389
+ pub const __UINT_FAST64_FMTX__ = "lX";
390
+ pub const __USER_LABEL_PREFIX__ = "";
391
+ pub const __FINITE_MATH_ONLY__ = @as(c_int, 0);
392
+ pub const __GNUC_STDC_INLINE__ = @as(c_int, 1);
393
+ pub const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = @as(c_int, 1);
394
+ pub const __CLANG_ATOMIC_BOOL_LOCK_FREE = @as(c_int, 2);
395
+ pub const __CLANG_ATOMIC_CHAR_LOCK_FREE = @as(c_int, 2);
396
+ pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE = @as(c_int, 2);
397
+ pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE = @as(c_int, 2);
398
+ pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE = @as(c_int, 2);
399
+ pub const __CLANG_ATOMIC_SHORT_LOCK_FREE = @as(c_int, 2);
400
+ pub const __CLANG_ATOMIC_INT_LOCK_FREE = @as(c_int, 2);
401
+ pub const __CLANG_ATOMIC_LONG_LOCK_FREE = @as(c_int, 2);
402
+ pub const __CLANG_ATOMIC_LLONG_LOCK_FREE = @as(c_int, 2);
403
+ pub const __CLANG_ATOMIC_POINTER_LOCK_FREE = @as(c_int, 2);
404
+ pub const __GCC_ATOMIC_BOOL_LOCK_FREE = @as(c_int, 2);
405
+ pub const __GCC_ATOMIC_CHAR_LOCK_FREE = @as(c_int, 2);
406
+ pub const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = @as(c_int, 2);
407
+ pub const __GCC_ATOMIC_CHAR32_T_LOCK_FREE = @as(c_int, 2);
408
+ pub const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = @as(c_int, 2);
409
+ pub const __GCC_ATOMIC_SHORT_LOCK_FREE = @as(c_int, 2);
410
+ pub const __GCC_ATOMIC_INT_LOCK_FREE = @as(c_int, 2);
411
+ pub const __GCC_ATOMIC_LONG_LOCK_FREE = @as(c_int, 2);
412
+ pub const __GCC_ATOMIC_LLONG_LOCK_FREE = @as(c_int, 2);
413
+ pub const __GCC_ATOMIC_POINTER_LOCK_FREE = @as(c_int, 2);
414
+ pub const __NO_INLINE__ = @as(c_int, 1);
415
+ pub const __PIC__ = @as(c_int, 2);
416
+ pub const __pic__ = @as(c_int, 2);
417
+ pub const __FLT_RADIX__ = @as(c_int, 2);
418
+ pub const __DECIMAL_DIG__ = __LDBL_DECIMAL_DIG__;
419
+ pub const __SSP_STRONG__ = @as(c_int, 2);
420
+ pub const __ELF__ = @as(c_int, 1);
421
+ pub const __GCC_ASM_FLAG_OUTPUTS__ = @as(c_int, 1);
422
+ pub const __code_model_small__ = @as(c_int, 1);
423
+ pub const __amd64__ = @as(c_int, 1);
424
+ pub const __amd64 = @as(c_int, 1);
425
+ pub const __x86_64 = @as(c_int, 1);
426
+ pub const __x86_64__ = @as(c_int, 1);
427
+ pub const __SEG_GS = @as(c_int, 1);
428
+ pub const __SEG_FS = @as(c_int, 1);
429
+ pub const __seg_gs = @compileError("unable to translate macro: undefined identifier `address_space`");
430
+ // (no file):358:9
431
+ pub const __seg_fs = @compileError("unable to translate macro: undefined identifier `address_space`");
432
+ // (no file):359:9
433
+ pub const __znver3 = @as(c_int, 1);
434
+ pub const __znver3__ = @as(c_int, 1);
435
+ pub const __tune_znver3__ = @as(c_int, 1);
436
+ pub const __REGISTER_PREFIX__ = "";
437
+ pub const __NO_MATH_INLINES = @as(c_int, 1);
438
+ pub const __AES__ = @as(c_int, 1);
439
+ pub const __VAES__ = @as(c_int, 1);
440
+ pub const __PCLMUL__ = @as(c_int, 1);
441
+ pub const __VPCLMULQDQ__ = @as(c_int, 1);
442
+ pub const __LAHF_SAHF__ = @as(c_int, 1);
443
+ pub const __LZCNT__ = @as(c_int, 1);
444
+ pub const __RDRND__ = @as(c_int, 1);
445
+ pub const __FSGSBASE__ = @as(c_int, 1);
446
+ pub const __BMI__ = @as(c_int, 1);
447
+ pub const __BMI2__ = @as(c_int, 1);
448
+ pub const __POPCNT__ = @as(c_int, 1);
449
+ pub const __PRFCHW__ = @as(c_int, 1);
450
+ pub const __RDSEED__ = @as(c_int, 1);
451
+ pub const __ADX__ = @as(c_int, 1);
452
+ pub const __MOVBE__ = @as(c_int, 1);
453
+ pub const __SSE4A__ = @as(c_int, 1);
454
+ pub const __FMA__ = @as(c_int, 1);
455
+ pub const __F16C__ = @as(c_int, 1);
456
+ pub const __SHA__ = @as(c_int, 1);
457
+ pub const __FXSR__ = @as(c_int, 1);
458
+ pub const __XSAVE__ = @as(c_int, 1);
459
+ pub const __XSAVEOPT__ = @as(c_int, 1);
460
+ pub const __XSAVEC__ = @as(c_int, 1);
461
+ pub const __XSAVES__ = @as(c_int, 1);
462
+ pub const __CLFLUSHOPT__ = @as(c_int, 1);
463
+ pub const __CLWB__ = @as(c_int, 1);
464
+ pub const __SHSTK__ = @as(c_int, 1);
465
+ pub const __CLZERO__ = @as(c_int, 1);
466
+ pub const __RDPID__ = @as(c_int, 1);
467
+ pub const __RDPRU__ = @as(c_int, 1);
468
+ pub const __INVPCID__ = @as(c_int, 1);
469
+ pub const __CRC32__ = @as(c_int, 1);
470
+ pub const __AVX2__ = @as(c_int, 1);
471
+ pub const __AVX__ = @as(c_int, 1);
472
+ pub const __SSE4_2__ = @as(c_int, 1);
473
+ pub const __SSE4_1__ = @as(c_int, 1);
474
+ pub const __SSSE3__ = @as(c_int, 1);
475
+ pub const __SSE3__ = @as(c_int, 1);
476
+ pub const __SSE2__ = @as(c_int, 1);
477
+ pub const __SSE2_MATH__ = @as(c_int, 1);
478
+ pub const __SSE__ = @as(c_int, 1);
479
+ pub const __SSE_MATH__ = @as(c_int, 1);
480
+ pub const __MMX__ = @as(c_int, 1);
481
+ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = @as(c_int, 1);
482
+ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = @as(c_int, 1);
483
+ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = @as(c_int, 1);
484
+ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = @as(c_int, 1);
485
+ pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = @as(c_int, 1);
486
+ pub const __SIZEOF_FLOAT128__ = @as(c_int, 16);
487
+ pub const unix = @as(c_int, 1);
488
+ pub const __unix = @as(c_int, 1);
489
+ pub const __unix__ = @as(c_int, 1);
490
+ pub const linux = @as(c_int, 1);
491
+ pub const __linux = @as(c_int, 1);
492
+ pub const __linux__ = @as(c_int, 1);
493
+ pub const __gnu_linux__ = @as(c_int, 1);
494
+ pub const __FLOAT128__ = @as(c_int, 1);
495
+ pub const __STDC__ = @as(c_int, 1);
496
+ pub const __STDC_HOSTED__ = @as(c_int, 1);
497
+ pub const __STDC_VERSION__ = @as(c_long, 201710);
498
+ pub const __STDC_UTF_16__ = @as(c_int, 1);
499
+ pub const __STDC_UTF_32__ = @as(c_int, 1);
500
+ pub const __GLIBC_MINOR__ = @as(c_int, 39);
501
+ pub const _DEBUG = @as(c_int, 1);
502
+ pub const __GCC_HAVE_DWARF2_CFI_ASM = @as(c_int, 1);
503
+ pub const ZHTML2PDF_H = "";
Binary file
Binary file
@@ -0,0 +1,63 @@
1
+ require 'rspec'
2
+ require 'base64'
3
+ require_relative '../lib/zhtml2pdf'
4
+
5
+ describe ZHtml2Pdf do
6
+ let(:converter) { ZHtml2Pdf::Converter.new }
7
+ let(:html_text) {
8
+ "data:text/html;charset=utf-8,<!DOCTYPE html>
9
+ <html lang='en'>
10
+ <head>
11
+ <meta charset='UTF-8'>
12
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
13
+ <title>Sample PDF Content</title>
14
+ <style>
15
+ body { font-family: Arial, sans-serif; margin: 20px; }
16
+ h1 { color: #333366; }
17
+ p { font-size: 14px; color: #555555; }
18
+ .container { border: 1px solid #ddd; padding: 15px; border-radius: 5px; }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <div class='container'>
23
+ <h1>PDF Generation Test</h1>
24
+ <p>This is a sample HTML document for testing PDF conversion.</p>
25
+ <ul>
26
+ <li>Item 1</li>
27
+ <li>Item 2</li>
28
+ <li>Item 3</li>
29
+ </ul>
30
+ </div>
31
+ </body>
32
+ </html>"
33
+ }
34
+ let(:base64_encoded) { Base64.strict_encode64(File.open("#{File.dirname(__FILE__)}/test.pdf", 'rb').read).encode('ASCII-8BIT') }
35
+
36
+ describe '#initialize' do
37
+ it 'initializes the converter' do
38
+ ZHtml2Pdf::Converter.new
39
+ end
40
+ end
41
+
42
+ describe '#convert' do
43
+ it 'calls zhtml2pdf with correct parameters' do
44
+ content = converter.convert(html_text, nil, nil)
45
+ end
46
+
47
+ it 'returns a string base64 encoded with at least 98% similarity' do
48
+ content = converter.convert(html_text, nil, nil)
49
+
50
+ total_chars = [content.length, base64_encoded.length].min
51
+ match_count = 0
52
+
53
+ content.chars.zip(base64_encoded.chars).each_with_index do |(a, b), index|
54
+ match_count += 1 if a == b
55
+ end
56
+
57
+ # I test here against similarity cause WebKit2 during print
58
+ # adds timestamps to metadata and we ain't want to get rid off those guys
59
+ similarity = match_count.to_f / total_chars
60
+ expect(similarity).to be >= 0.98
61
+ end
62
+ end
63
+ end
data/src/zhtml2pdf.c ADDED
@@ -0,0 +1,277 @@
1
+ #include <stdio.h>
2
+ #include <webkit2/webkit2.h>
3
+ #include <sys/stat.h>
4
+
5
+ #include "zhtml2pdf.h"
6
+
7
+ static int nonthreaded_init = 0;
8
+
9
+ static GThread *loop_thread = 0;
10
+ static GMainLoop *loop = 0;
11
+
12
+
13
+ struct ZHTML2PDF_CONTEXT {
14
+ GtkPrintSettings *settings;
15
+ WebKitPrintOperation *operation;
16
+ GMainLoop *loop;
17
+ };
18
+
19
+ struct html2pdf_params {
20
+ const char *input;
21
+ const char *output;
22
+ const char *settings;
23
+ const char *css;
24
+
25
+ GCond *wait_cond;
26
+ GMutex *wait_mutex;
27
+ int *wait_data;
28
+ };
29
+
30
+ #define CONTEXT ((struct ZHTML2PDF_CONTEXT*)user_data)
31
+
32
+ static int _html2pdf(struct html2pdf_params* params);
33
+ static void* _event_loop_function(void* data);
34
+ static int _read_file_contents(const char* filename, unsigned char** output);
35
+ void _encode_base64(const unsigned char* input, size_t length, unsigned char* output);
36
+
37
+
38
+ void init_zhtml2pdf() {
39
+ gtk_init_check(NULL, NULL);
40
+ nonthreaded_init = 1;
41
+ }
42
+
43
+ void deinit_zhtml2pdf() {
44
+ gtk_init_check(NULL, NULL);
45
+ }
46
+
47
+ void init_loop_zhtml2pdf() {
48
+ if (loop_thread != NULL) return;
49
+ struct timespec ts;
50
+ ts.tv_sec = 0;
51
+ ts.tv_nsec = 1000000;
52
+
53
+ loop_thread = g_thread_new("zhtml2pdf_event_loop", _event_loop_function, NULL);
54
+
55
+ while (loop == NULL) nanosleep(&ts, NULL);
56
+
57
+ while (!g_main_loop_is_running(loop)) nanosleep(&ts, NULL);
58
+ }
59
+
60
+ void deinit_loop_zhtml2pdf() {
61
+ g_main_loop_quit(loop);
62
+ g_thread_join(loop_thread);
63
+ g_main_loop_unref(loop);
64
+ }
65
+
66
+ void zhtml2pdf_free(void** buffer) {
67
+ if (buffer != NULL || *buffer != NULL) {
68
+ free(*buffer);
69
+ *buffer = NULL;
70
+ }
71
+ }
72
+
73
+
74
+ int zhtml2pdf(const char* input, const char* settings, const char* css, unsigned char** output) {
75
+ struct html2pdf_params *params = malloc(sizeof(struct html2pdf_params));
76
+ if (params == NULL) return -1;
77
+
78
+ params->input = input;
79
+ params->output = "file:///tmp/zhtml2pdf_tempfile";
80
+ params->settings = settings;
81
+ params->css = css;
82
+
83
+ params->wait_mutex = NULL;
84
+ params->wait_cond = NULL;
85
+ params->wait_data = NULL;
86
+
87
+ if (!nonthreaded_init && g_main_context_default() != NULL) {
88
+ GMutex wait_mutex;
89
+ GCond wait_cond;
90
+ int wait_data = 0;
91
+
92
+ g_mutex_init(&wait_mutex);
93
+ g_cond_init(&wait_cond);
94
+
95
+ params->wait_cond = &wait_cond;
96
+ params->wait_mutex = &wait_mutex;
97
+ params->wait_data = &wait_data;
98
+
99
+ g_idle_add((GSourceFunc)_html2pdf, params);
100
+
101
+ g_mutex_lock(&wait_mutex);
102
+ while (wait_data == 0) {
103
+ g_cond_wait(&wait_cond, &wait_mutex);
104
+ }
105
+
106
+ g_mutex_unlock(&wait_mutex);
107
+
108
+ g_mutex_clear(&wait_mutex);
109
+ g_cond_clear(&wait_cond);
110
+ free(params);
111
+
112
+ return -2;
113
+ }
114
+
115
+ _html2pdf(params);
116
+ free(params);
117
+
118
+ return _read_file_contents("/tmp/zhtml2pdf_tempfile", output);
119
+ }
120
+
121
+ static void* _event_loop_function(void* data) {
122
+ gtk_init_check (NULL, NULL);
123
+ loop = g_main_loop_new(NULL,false);
124
+
125
+ g_main_loop_run(loop);
126
+ }
127
+
128
+ static void _web_view_load_changed(WebKitWebView* web_view, WebKitLoadEvent load_event, void* user_data) {
129
+ switch (load_event) {
130
+ case WEBKIT_LOAD_STARTED:
131
+ break;
132
+ case WEBKIT_LOAD_REDIRECTED:
133
+ break;
134
+ case WEBKIT_LOAD_COMMITTED:
135
+ break;
136
+ case WEBKIT_LOAD_FINISHED: {
137
+ WebKitPrintOperation *operation = CONTEXT->operation;
138
+ webkit_print_operation_print(operation);
139
+ break;
140
+ }
141
+ }
142
+ }
143
+
144
+ static void _print_finished(WebKitPrintOperation* operation, void* user_data) {
145
+ g_main_loop_quit(CONTEXT->loop);
146
+ }
147
+
148
+ static int _html2pdf(struct html2pdf_params* params) {
149
+ struct ZHTML2PDF_CONTEXT context;
150
+
151
+ GtkPrintSettings *settings = gtk_print_settings_new();
152
+ gtk_print_settings_set_printer(settings, "Print to File");
153
+ gtk_print_settings_set(settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT, "pdf");
154
+ gtk_print_settings_set_quality(settings, GTK_PRINT_QUALITY_HIGH);
155
+ gtk_print_settings_set_resolution(settings, 320);
156
+ gtk_print_settings_set_page_set(settings, GTK_PAGE_SET_ALL);
157
+ gtk_print_settings_set_orientation(settings, GTK_PAGE_ORIENTATION_PORTRAIT);
158
+ gtk_print_settings_set_paper_width(settings, 500, GTK_UNIT_MM);
159
+
160
+ GtkPageSetup *page_setup = gtk_page_setup_new();
161
+ gtk_page_setup_set_orientation(page_setup, GTK_PAGE_ORIENTATION_PORTRAIT);
162
+
163
+ if (params->settings != NULL) {
164
+ GKeyFile *key_file = g_key_file_new();
165
+ g_key_file_load_from_data(key_file, params->settings, (gsize)-1, G_KEY_FILE_NONE, NULL);
166
+ gtk_page_setup_load_key_file(page_setup, key_file, NULL, NULL);
167
+ gtk_print_settings_load_key_file(settings, key_file, NULL, NULL);
168
+ g_key_file_free(key_file);
169
+ }
170
+
171
+ gtk_print_settings_set(settings, GTK_PRINT_SETTINGS_OUTPUT_URI, params->output);
172
+ context.settings = settings;
173
+
174
+ WebKitWebContext *web_context = webkit_web_context_new_ephemeral();
175
+ WebKitWebView *web_view = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(web_context));
176
+ // webkit_web_context_set_disk_cache_directory(web_context, "/dev/null");
177
+ // webkit_web_context_set_cache_model(web_context, WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER)
178
+
179
+ g_object_ref_sink(web_view);
180
+
181
+ WebKitSettings *view_settings = webkit_web_view_get_settings(web_view);
182
+ webkit_settings_set_enable_javascript(view_settings, false);
183
+ webkit_settings_set_enable_page_cache(view_settings, false);
184
+ webkit_settings_set_enable_html5_database(view_settings, false);
185
+ webkit_settings_set_enable_html5_local_storage(view_settings, false);
186
+ webkit_settings_set_enable_offline_web_application_cache(view_settings, false);
187
+
188
+ WebKitPrintOperation *operation = webkit_print_operation_new(web_view);
189
+ webkit_print_operation_set_print_settings(operation, settings);
190
+ webkit_print_operation_set_page_setup(operation, page_setup);
191
+ g_signal_connect(operation, "finished", (void (*)(void))_print_finished, &context);
192
+ context.operation = operation;
193
+
194
+ GMainLoop *loop = g_main_loop_new(NULL, false);
195
+ context.loop = loop;
196
+
197
+ g_signal_connect(web_view, "load-changed", (void (*)(void))_web_view_load_changed, &context);
198
+
199
+ webkit_web_view_load_uri(web_view, params->input);
200
+
201
+ g_main_loop_run(loop);
202
+
203
+ g_object_unref(G_OBJECT(operation));
204
+ g_object_unref(G_OBJECT(settings));
205
+ g_object_unref(G_OBJECT(page_setup));
206
+ gtk_widget_destroy(GTK_WIDGET(web_view));
207
+ g_object_unref(G_OBJECT(web_view));
208
+ g_object_unref(G_OBJECT(web_context));
209
+ g_main_loop_unref(loop);
210
+
211
+ if (params->wait_mutex && params->wait_cond && params->wait_data) {
212
+ g_mutex_lock(params->wait_mutex);
213
+ (*params->wait_data)++;
214
+ g_cond_signal(params->wait_cond);
215
+ g_mutex_unlock(params->wait_mutex);
216
+ }
217
+
218
+ return G_SOURCE_REMOVE;
219
+ }
220
+
221
+ static int _read_file_contents(const char* filename, unsigned char** output) {
222
+ struct stat st;
223
+
224
+ if (stat(filename, &st) == -1) return -1;
225
+
226
+ size_t file_size = st.st_size;
227
+
228
+ FILE *file_pointer = fopen(filename, "rb");
229
+ if (!file_pointer) return -2;
230
+
231
+ unsigned char *file_content = malloc(file_size);
232
+ if (!file_content) {
233
+ fclose(file_pointer);
234
+ return -3;
235
+ }
236
+
237
+ size_t bytes_read = fread(file_content, 1, file_size, file_pointer);
238
+ if (bytes_read != file_size) {
239
+ free(file_content);
240
+ fclose(file_pointer);
241
+ return -4;
242
+ }
243
+
244
+ int encoded_size = ((file_size + 2) / 3) * 4;
245
+ unsigned char *encoded = malloc(encoded_size);
246
+ if (!encoded) {
247
+ free(file_content);
248
+ fclose(file_pointer);
249
+ return -5;
250
+ }
251
+
252
+ _encode_base64(file_content, file_size, encoded);
253
+
254
+ free(file_content);
255
+ *output = encoded;
256
+
257
+ fclose(file_pointer);
258
+ return encoded_size;
259
+ }
260
+
261
+ const char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
262
+
263
+ void _encode_base64(const unsigned char* input, size_t length, unsigned char* output) {
264
+ int i, j = 0;
265
+ unsigned char a, b, c;
266
+
267
+ for (i = 0; i < length; i += 3) {
268
+ a = input[i];
269
+ b = (i + 1 < length) ? input[i + 1] : 0;
270
+ c = (i + 2 < length) ? input[i + 2] : 0;
271
+
272
+ output[j++] = base64_table[a >> 2];
273
+ output[j++] = base64_table[((a & 0x03) << 4) | (b >> 4)];
274
+ output[j++] = (i + 1 < length) ? base64_table[((b & 0x0F) << 2) | (c >> 6)] : '=';
275
+ output[j++] = (i + 2 < length) ? base64_table[c & 0x3F] : '=';
276
+ }
277
+ }
data/src/zhtml2pdf.h ADDED
@@ -0,0 +1,19 @@
1
+ #ifndef ZHTML2PDF_H
2
+ #define ZHTML2PDF_H
3
+
4
+ void init_zhtml2pdf();
5
+ void init_loop_zhtml2pdf();
6
+
7
+ int zhtml2pdf(
8
+ const char* input,
9
+ const char* settings,
10
+ const char* css,
11
+ unsigned char** output
12
+ );
13
+
14
+ void zhtml2pdf_free(void** buffer);
15
+
16
+ void deinit_zhtml2pdf();
17
+ void deinit_loop_zhtml2pdf();
18
+
19
+ #endif //ZHTML2PDF_H
data/zhtml2pdf.gemspec ADDED
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'zhtml2pdf'
3
+ s.version = '0.0.2'
4
+ s.summary = 'Convert HTML to PDF easily'
5
+ s.description = 'Ruby bindings for libzhtml2pdf to convert HTML files to PDF using webkit2'
6
+ s.authors = ['sectasy0']
7
+ s.email = 'sectasy0@gmail.com'
8
+ s.files = Dir.glob('{LICENSE,README.md,Rakefile,zhtml2pdf.gemspec,bindings/ruby/**/*,src/**/*}')
9
+ s.homepage = 'https://rubygems.org/gems/zhtml2pdf'
10
+ s.license = 'MIT'
11
+
12
+ s.require_paths = ['bindings/ruby/lib']
13
+
14
+ s.extensions = ['bindings/ruby/ext/zhtml2pdf/extconf.rb']
15
+
16
+ s.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
17
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zhtml2pdf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - sectasy0
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-02-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby bindings for libzhtml2pdf to convert HTML files to PDF using webkit2
14
+ email: sectasy0@gmail.com
15
+ executables: []
16
+ extensions:
17
+ - bindings/ruby/ext/zhtml2pdf/extconf.rb
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - Rakefile
23
+ - bindings/ruby/README.md
24
+ - bindings/ruby/ext/zhtml2pdf/Makefile
25
+ - bindings/ruby/ext/zhtml2pdf/build.zig
26
+ - bindings/ruby/ext/zhtml2pdf/extconf.rb
27
+ - bindings/ruby/ext/zhtml2pdf/src/main.zig
28
+ - bindings/ruby/ext/zhtml2pdf/src/zhtml2pdf.zig
29
+ - bindings/ruby/lib/zhtml2pdf.so
30
+ - bindings/ruby/spec/test.pdf
31
+ - bindings/ruby/spec/zhtml2pdf.rb
32
+ - src/zhtml2pdf.c
33
+ - src/zhtml2pdf.h
34
+ - zhtml2pdf.gemspec
35
+ homepage: https://rubygems.org/gems/zhtml2pdf
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - bindings/ruby/lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.0
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.3.7
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Convert HTML to PDF easily
58
+ test_files: []