marqius-wkhtmltopdf 0.12.13

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: 29962c1626b7a79db0e0c3e6c223f7ef68be956c21dfa7baa28dfbcecc2dfa1b
4
+ data.tar.gz: d3a0f73f95ff5a31f747655f5fdc9f0402a235e0e78ffbf45639948e8ae54963
5
+ SHA512:
6
+ metadata.gz: b5c720ef9c0b9abc6ed60a1d0ef5838a6b9cd3f1e707209ae8089d2c78c7c070f38591225bb4d42c0123d8f3dcb0a1dc96bc425aa22cfe98f64be526514ebfce
7
+ data.tar.gz: 5a8ca3777bf55affac2d700689d01be8c2624af45f485257b4af25205e4082a66419dd361e40f34736a86a149f3bdc2c9b6010e93b750863a24e3706621e3fdf
data/LICENSE.md ADDED
@@ -0,0 +1,28 @@
1
+ # Licence
2
+
3
+ **The program.** marqius-wkhtmltopdf, which this gem installs, is commercial software from Simple AI
4
+ LLC. Its use is governed by the marqius-wkhtmltopdf Licence Agreement:
5
+ https://marqius.com/wkhtmltopdf/licence-agreement/. It has a 30-day free trial counted from its first
6
+ run; after the trial, without a licence, each page it makes carries one line, "Prepared by Marqius,
7
+ Purchase Licence". Personal, teaching and open-source use is free with a Community licence. Plans and
8
+ licences: https://marqius.com/licence/marqius-wkhtmltopdf
9
+
10
+ **This gem's own files** (the Ruby code and commands that give your library the path of the program
11
+ it carries) are released under the MIT licence:
12
+
13
+ Copyright (c) 2026 Simple AI LLC
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
16
+ associated documentation files (the "Software"), to deal in the Software without restriction,
17
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
18
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or
22
+ substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
25
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
27
+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # marqius-wkhtmltopdf: the wkhtmltopdf gem for Rails, wicked_pdf and PDFKit
2
+
3
+ **marqius-wkhtmltopdf is the maintained drop-in replacement for wkhtmltopdf, as a Ruby gem.** Add one line to your Gemfile, and wicked_pdf or PDFKit keep making PDFs on Heroku-24, Debian 13, Alpine and macOS, with no other change. It replaces the `wkhtmltopdf-binary` gem, and it runs on Windows too.
4
+
5
+ ## How do I install wkhtmltopdf in a Rails app?
6
+
7
+ Add the gem to your Gemfile:
8
+
9
+ <!-- install -->
10
+ ```ruby
11
+ gem "marqius-wkhtmltopdf"
12
+ ```
13
+
14
+ Then install it:
15
+
16
+ <!-- bundle -->
17
+ ```bash
18
+ bundle install
19
+ ```
20
+
21
+ That's all. Bundler picks the gem for your computer, and that gem carries the program, so nothing else is downloaded, at install or when your app runs. It works in CI too. For a server that cannot reach the internet, install from `bundle cache --all-platforms`.
22
+
23
+ Do you work on a Mac and deploy to Linux? Add Linux to your `Gemfile.lock` once:
24
+
25
+ <!-- lock -->
26
+ ```bash
27
+ bundle lock --add-platform x86_64-linux aarch64-linux
28
+ ```
29
+
30
+ ## What replaces the wkhtmltopdf-binary gem?
31
+
32
+ marqius-wkhtmltopdf does. In your Gemfile, replace `gem "wkhtmltopdf-binary"` with `gem "marqius-wkhtmltopdf"`, then run `bundle install`. On Linux and macOS, wicked_pdf and PDFKit find the new program by themselves.
33
+
34
+ wkhtmltopdf-binary is a 450 MB download of wkhtmltopdf builds made for older systems. Each marqius-wkhtmltopdf gem is about 9 MB and carries one maintained program, for your platform.
35
+
36
+ ## How do I use wkhtmltopdf with wicked_pdf on Heroku-24 or Debian 13?
37
+
38
+ Install the gem. On Linux and macOS, wicked_pdf finds it by itself, so you change nothing else.
39
+
40
+ Your code may name the program, for example with `Gem.bin_path("wkhtmltopdf-binary", "wkhtmltopdf")` or `/usr/local/bin/wkhtmltopdf`. If so, point it at the gem instead; on Windows, always do this. In `config/initializers/wicked_pdf.rb`:
41
+
42
+ <!-- example: wicked_pdf -->
43
+ ```ruby
44
+ WickedPdf.configure do |config|
45
+ config.exe_path = MarqiusWkhtmltopdf.executable_path
46
+ end
47
+ ```
48
+
49
+ wicked_pdf 2.7 and earlier have no `WickedPdf.configure`. There, write:
50
+
51
+ <!-- example: wicked_pdf 2.7 -->
52
+ ```ruby
53
+ WickedPdf.config[:exe_path] = MarqiusWkhtmltopdf.executable_path
54
+ ```
55
+
56
+ ## How do I use wkhtmltopdf with PDFKit?
57
+
58
+ Install the gem. On Linux and macOS, PDFKit finds it by itself. To name it yourself, as on Windows:
59
+
60
+ <!-- example: pdfkit -->
61
+ ```ruby
62
+ PDFKit.configure do |config|
63
+ config.wkhtmltopdf = MarqiusWkhtmltopdf.executable_path
64
+ end
65
+ ```
66
+
67
+ ## Why do I get "wkhtmltopdf not found" errors?
68
+
69
+ Your library cannot find a wkhtmltopdf program:
70
+
71
+ - wicked_pdf says "Location of wkhtmltopdf unknown" or "Bad wkhtmltopdf's path".
72
+ - PDFKit says "No wkhtmltopdf executable found".
73
+
74
+ Install this gem. On Linux and macOS, both libraries then find the program by themselves. If your code names a path, or you are on Windows, point it at `MarqiusWkhtmltopdf.executable_path`, as shown above.
75
+
76
+ ## Why does wkhtmltopdf fail with "libssl.so.1.1: cannot open shared object file"?
77
+
78
+ Your wkhtmltopdf was built for an older system. It needs OpenSSL 1.1, which Heroku-24 (Ubuntu 24.04) and Debian 13 no longer include. marqius-wkhtmltopdf needs no system libraries, so it runs there as it is.
79
+
80
+ ## Which systems does marqius-wkhtmltopdf run on?
81
+
82
+ It runs on:
83
+
84
+ - Linux on x86-64 and ARM64, with glibc or musl (so Alpine too);
85
+ - Macs with Apple silicon;
86
+ - Windows on x64.
87
+
88
+ Bundler installs the right gem for each. It needs no X server, Qt or system libraries. In a slim or Alpine image without fonts, the program says so and prints the one line that installs them.
89
+
90
+ ## Is marqius-wkhtmltopdf free?
91
+
92
+ You can try it free for 30 days. Personal, teaching and open-source use is free with a [Community licence](https://marqius.com/wkhtmltopdf-buy/#community): sign in with Google and your free key is waiting in your account.
93
+
94
+ Anything done by or for a business, including internal tools and client work, needs Starter or above once the trial ends. Starter is $290 USD a year for organisations of up to 10 people, and Business $990 USD a year, plus applicable taxes.
95
+
96
+ Your PDFs never stop. Without a licence after the trial, each page carries one line, "Prepared by Marqius, Purchase Licence". [Plans and licences](https://marqius.com/licence/marqius-wkhtmltopdf) · [Licence terms](https://marqius.com/wkhtmltopdf/licence-agreement/)
97
+
98
+ ## How do I add my licence key?
99
+
100
+ Set the `MARQIUS_LICENCE` environment variable to your licence; that is the way for Heroku, containers and CI. Or save it as `licence.txt` and run `bundle exec marqius-wkhtmltopdf licence add licence.txt`.
101
+
102
+ To see the trial's days left, or the licence in force:
103
+
104
+ <!-- licence -->
105
+ ```bash
106
+ bundle exec marqius-wkhtmltopdf licence
107
+ ```
108
+
109
+ ## Does it pass wicked_pdf's and PDFKit's own tests?
110
+
111
+ Yes. wicked_pdf and PDFKit pass their own test suites with marqius-wkhtmltopdf: all 45 of wicked_pdf's tests, and PDFKit's with no failures. The results are public: [wkhtmltopdf library tests](https://github.com/marqiushq/wkhtmltopdf-library-tests).
112
+
113
+ Before each version of this gem is published, [its workflow](https://github.com/marqiushq/marqius-wkhtmltopdf-ruby/blob/main/.github/workflows/release.yml) runs:
114
+
115
+ - both suites again, with the gem itself, on Linux (x86-64 and ARM64);
116
+ - the install steps and examples on this page, on Linux, macOS and Windows.
117
+
118
+ ## How do I update it?
119
+
120
+ Each version of this gem carries the marqius-wkhtmltopdf release with the same number. To move to the newest:
121
+
122
+ <!-- update -->
123
+ ```bash
124
+ bundle update marqius-wkhtmltopdf
125
+ ```
126
+
127
+ This gem's own Ruby files are under the MIT licence: [LICENSE.md](LICENSE.md).
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # marqius-wkhtmltopdf under its own name (bundle exec marqius-wkhtmltopdf): licence, help, compare
5
+ # and wkhtmltopdf's command line. Commercial software with a 30-day free trial.
6
+ require_relative "../lib/marqius_wkhtmltopdf"
7
+
8
+ begin
9
+ program = MarqiusWkhtmltopdf.program
10
+ rescue MarqiusWkhtmltopdf::Error => e
11
+ abort e.message
12
+ end
13
+ exec [program, "marqius-wkhtmltopdf"], *ARGV # never through a shell, even with no arguments
data/exe/wkhtmltoimage ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # wkhtmltoimage, for IMGKit and the other libraries that look for it with Bundler or on the PATH:
5
+ # it starts marqius-wkhtmltopdf, which this gem carries, as wkhtmltoimage.
6
+ require_relative "../lib/marqius_wkhtmltopdf"
7
+
8
+ begin
9
+ program = MarqiusWkhtmltopdf.program
10
+ rescue MarqiusWkhtmltopdf::Error => e
11
+ abort e.message
12
+ end
13
+ exec program, "wkhtmltoimage", *ARGV
data/exe/wkhtmltopdf ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # wkhtmltopdf, for wicked_pdf, PDFKit and the other libraries that look for it with Bundler or on
5
+ # the PATH, as they found wkhtmltopdf-binary's: it starts marqius-wkhtmltopdf, which this gem carries.
6
+ require_relative "../lib/marqius_wkhtmltopdf"
7
+
8
+ begin
9
+ program = MarqiusWkhtmltopdf.program
10
+ rescue MarqiusWkhtmltopdf::Error => e
11
+ abort e.message
12
+ end
13
+ exec program, "wkhtmltopdf", *ARGV
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The gem's own name, which Bundler.require loads in a Rails app: see marqius_wkhtmltopdf.rb.
4
+ require_relative "marqius_wkhtmltopdf"
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ # marqius-wkhtmltopdf for Ruby's wkhtmltopdf libraries.
4
+ #
5
+ # MarqiusWkhtmltopdf.executable_path gives the installed program's path, to give wicked_pdf, PDFKit
6
+ # or another library where it asks for wkhtmltopdf:
7
+ #
8
+ # WickedPdf.configure { |config| config.exe_path = MarqiusWkhtmltopdf.executable_path }
9
+ #
10
+ # Most apps need not: the gem's wkhtmltopdf command, which those libraries find with Bundler as they
11
+ # found wkhtmltopdf-binary's, starts the same program. The gem Bundler installs for each platform
12
+ # carries the program itself. marqius-wkhtmltopdf is commercial software from Simple AI LLC, with a
13
+ # 30-day free trial: https://marqius.com/licence/marqius-wkhtmltopdf
14
+ module MarqiusWkhtmltopdf
15
+ VERSION = "0.12.13"
16
+
17
+ # The platforms with a gem that carries the program, in RubyGems' names. The Linux programs are
18
+ # static, so each Linux gem serves glibc and musl (Alpine) alike.
19
+ PLATFORMS = %w[x86_64-linux aarch64-linux arm64-darwin x64-mingw-ucrt].freeze
20
+
21
+ # Raised when the gem installed here carries no program: the plain ruby gem.
22
+ class Error < StandardError; end
23
+
24
+ LIBEXEC = File.expand_path("../libexec", __dir__)
25
+ WINDOWS = Gem.win_platform?
26
+ private_constant :LIBEXEC, :WINDOWS
27
+
28
+ # The installed program's path, as wkhtmltopdf: give it where a library asks for wkhtmltopdf.
29
+ def self.executable_path
30
+ exe = program
31
+ return File.join(LIBEXEC, "wkhtmltopdf") unless WINDOWS # a few lines of sh that start it as wkhtmltopdf
32
+
33
+ windows_name(exe, "wkhtmltopdf")
34
+ end
35
+
36
+ # The program under its own name, marqius-wkhtmltopdf, for the gem's commands. Not public API.
37
+ def self.program # :nodoc:
38
+ exe = File.join(LIBEXEC, WINDOWS ? "marqius-wkhtmltopdf.exe" : "marqius-wkhtmltopdf")
39
+ return exe if File.file?(exe)
40
+
41
+ here = Gem::Platform.local
42
+ ours = PLATFORMS.find { |platform| Gem::Platform.new(platform) === here }
43
+ raise Error, "marqius-wkhtmltopdf has no program for #{here}: it runs on #{PLATFORMS.join(', ')}; " \
44
+ "for another platform, write to hello@marqius.com" unless ours
45
+
46
+ raise Error, "marqius-wkhtmltopdf: Bundler installed the gem without the program; add #{ours} to " \
47
+ "Gemfile.lock with `bundle lock --add-platform #{ours}`, then run `bundle install` " \
48
+ "(with Bundler's force_ruby_platform off)"
49
+ end
50
+
51
+ # On Windows the program answers to wkhtmltopdf.exe by its file name: a hard link beside it, made
52
+ # once (a copy in the temporary folder where the gem's folder cannot be written).
53
+ def self.windows_name(exe, name)
54
+ require "tmpdir"
55
+ size = File.size(exe)
56
+ [LIBEXEC, File.join(Dir.tmpdir, "marqius-wkhtmltopdf-#{VERSION}")].each do |place|
57
+ to = File.join(place, "#{name}.exe")
58
+ return to if File.file?(to) && File.size(to) == size
59
+
60
+ begin
61
+ Dir.mkdir(place) unless File.directory?(place)
62
+ File.delete(to) if File.exist?(to)
63
+ begin
64
+ File.link(exe, to)
65
+ rescue SystemCallError, NotImplementedError
66
+ File.binwrite(to, File.binread(exe))
67
+ end
68
+ return to
69
+ rescue SystemCallError
70
+ next # this folder cannot be written: try the next
71
+ end
72
+ end
73
+ raise Error, "marqius-wkhtmltopdf cannot be given the name #{name}.exe: " \
74
+ "neither #{LIBEXEC} nor #{Dir.tmpdir} can be written"
75
+ end
76
+ private_class_method :windows_name
77
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: marqius-wkhtmltopdf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.12.13
5
+ platform: ruby
6
+ authors:
7
+ - Simple AI LLC
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 2026-01-01 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Add one line to your Gemfile and wicked_pdf or PDFKit keep making PDFs
13
+ on Heroku-24, Debian 13, Alpine and macOS, with no other change; it runs on Windows
14
+ too. It replaces the wkhtmltopdf-binary gem and fixes "wkhtmltopdf not found" and
15
+ "libssl.so.1.1" errors. Each platform's gem carries the program, so nothing else
16
+ is downloaded. Personal, teaching and open-source use is free with a Community licence.
17
+ email:
18
+ - hello@marqius.com
19
+ executables:
20
+ - marqius-wkhtmltopdf
21
+ - wkhtmltoimage
22
+ - wkhtmltopdf
23
+ extensions: []
24
+ extra_rdoc_files: []
25
+ files:
26
+ - LICENSE.md
27
+ - README.md
28
+ - exe/marqius-wkhtmltopdf
29
+ - exe/wkhtmltoimage
30
+ - exe/wkhtmltopdf
31
+ - lib/marqius-wkhtmltopdf.rb
32
+ - lib/marqius_wkhtmltopdf.rb
33
+ homepage: https://marqius.com/wkhtmltopdf/
34
+ licenses:
35
+ - LicenseRef-marqius-wkhtmltopdf
36
+ metadata:
37
+ homepage_uri: https://marqius.com/wkhtmltopdf/
38
+ source_code_uri: https://github.com/marqiushq/marqius-wkhtmltopdf-ruby
39
+ documentation_uri: https://marqius.com/download/developer-manual.pdf
40
+ changelog_uri: https://github.com/marqiushq/marqius-wkhtmltopdf/releases
41
+ bug_tracker_uri: https://github.com/marqiushq/marqius-wkhtmltopdf-ruby/issues
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '2.7'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubygems_version: 3.6.9
57
+ specification_version: 4
58
+ summary: 'The wkhtmltopdf gem for Rails, wicked_pdf and PDFKit: a maintained drop-in
59
+ replacement for wkhtmltopdf-binary that works on Heroku-24 and Debian 13 (commercial,
60
+ 30-day trial)'
61
+ test_files: []