ironpress 1.5.3 → 1.5.4
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 +4 -4
- data/README.md +57 -29
- data/ext/ironpress/Cargo.toml +2 -2
- data/lib/ironpress/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '06696b437bb27adfde76adbd80dc188f172812023a436b5feca2ade84a84f0a5'
|
|
4
|
+
data.tar.gz: 939d4e115c740e813f039bbfe8d90cc845477d4ad411dcc44ed68a436b654f3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5351e3994374da27eb84f5980a648ec59d70dae33f7f565820b5c0a73838704c1f8c424479c49242ff4920a9b7acb15cfdd3aa037ff8fc2163b530c3aa934a21
|
|
7
|
+
data.tar.gz: 781112a486eefcb602499c757865950921fb581e278d113ba9c3c95f0395708acad813682117f82508d7f5d931f21aa98d51782778ad37d401a57bd6b6b5584b
|
data/README.md
CHANGED
|
@@ -1,58 +1,86 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ironpress for Ruby
|
|
2
2
|
|
|
3
|
-
Generate PDF
|
|
3
|
+
Generate PDF output from HTML or Markdown with a native Rust renderer. No
|
|
4
|
+
browser process or system PDF dependency is required.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
[Read the complete Ruby getting-started guide](https://gastongouron.github.io/ironpress/get-started/ruby/).
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- Ruby 3.0 or later
|
|
11
|
+
- Linux, macOS, or Windows
|
|
12
|
+
|
|
13
|
+
Releases include supported native gems plus a source gem.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bundle add ironpress
|
|
9
19
|
```
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
gems for Linux, macOS, and Windows.
|
|
21
|
+
Or install the gem globally:
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
```bash
|
|
24
|
+
gem install ironpress
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Create your first PDF
|
|
15
28
|
|
|
16
29
|
```ruby
|
|
17
30
|
require "ironpress"
|
|
18
31
|
|
|
19
|
-
pdf = Ironpress.html_to_pdf("<h1>Hello</h1>")
|
|
32
|
+
pdf = Ironpress.html_to_pdf("<h1>Hello from Ruby</h1>")
|
|
20
33
|
File.binwrite("output.pdf", pdf)
|
|
21
34
|
```
|
|
22
35
|
|
|
23
|
-
|
|
24
|
-
|
|
36
|
+
The result is a binary Ruby `String`. Write it with `File.binwrite`, return it
|
|
37
|
+
from a web response, or store it in your application.
|
|
38
|
+
|
|
39
|
+
## Render Markdown
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
pdf = Ironpress.markdown_to_pdf("# Release notes\n\nEverything shipped.")
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Configure and reuse a converter
|
|
25
46
|
|
|
26
47
|
```ruby
|
|
27
48
|
converter = Ironpress::HtmlConverter.new
|
|
28
49
|
.page_size("Letter")
|
|
29
|
-
.margin_sides(36,
|
|
50
|
+
.margin_sides(36, 48, 36, 48)
|
|
30
51
|
.header("Quarterly report")
|
|
31
52
|
.footer("Page {page} of {pages}")
|
|
32
|
-
.sanitize(true)
|
|
33
53
|
|
|
34
54
|
pdf = converter.convert("<h1>Results</h1>")
|
|
55
|
+
markdown_pdf = converter.convert_markdown("# Results")
|
|
35
56
|
```
|
|
36
57
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Ruby also supports constrained local resources through `base_path` and
|
|
40
|
-
`resource_root`, plus direct file output.
|
|
58
|
+
Configuration methods return the converter, so policies compose in an idiomatic
|
|
59
|
+
chain. Use `convert_to_file` or `convert_markdown_to_file` for direct output.
|
|
41
60
|
|
|
42
|
-
|
|
43
|
-
Rust, Python, and WebAssembly.
|
|
61
|
+
## Local resources and fonts
|
|
44
62
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Ironpress never downloads fallback fonts while rendering. Download the artifact
|
|
48
|
-
your application needs, verify it as part of deployment, then install its bytes:
|
|
63
|
+
Local URLs are denied until a canonical boundary is configured:
|
|
49
64
|
|
|
50
65
|
```ruby
|
|
51
|
-
converter = Ironpress::HtmlConverter.new
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
pdf = converter.convert("<p lang='ja'>日本語</p>")
|
|
66
|
+
converter = Ironpress::HtmlConverter.new
|
|
67
|
+
.base_path("templates")
|
|
68
|
+
.resource_root(".")
|
|
69
|
+
.add_font("Inter", File.binread("assets/Inter.ttf"))
|
|
56
70
|
```
|
|
57
71
|
|
|
58
|
-
|
|
72
|
+
Optional fallback packs enter through `add_font_pack`. Valid names are
|
|
73
|
+
`cjk-jp`, `cjk-kr`, `cjk-sc`, `cjk-tc`, and `emoji`. Rendering never downloads
|
|
74
|
+
a font pack.
|
|
75
|
+
|
|
76
|
+
## Limits and errors
|
|
77
|
+
|
|
78
|
+
- Invalid named settings raise `ArgumentError`.
|
|
79
|
+
- Conversion failures raise `RuntimeError`.
|
|
80
|
+
- HTML sanitization is enabled by default.
|
|
81
|
+
- The binding has no async or streaming conversion API.
|
|
82
|
+
- Remote HTTP document resources are not available.
|
|
83
|
+
- JavaScript and browser DOM execution are not supported.
|
|
84
|
+
|
|
85
|
+
See the [binding capability matrix](../README.md) for the contract shared with
|
|
86
|
+
Rust, Python, browser WebAssembly, and Node.js.
|
data/ext/ironpress/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "ironpress-ruby"
|
|
3
|
-
version = "1.5.
|
|
3
|
+
version = "1.5.4"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
publish = false
|
|
6
6
|
description = "Ruby bindings for the Ironpress HTML-to-PDF engine"
|
|
@@ -12,6 +12,6 @@ name = "ironpress_ruby"
|
|
|
12
12
|
crate-type = ["cdylib"]
|
|
13
13
|
|
|
14
14
|
[dependencies]
|
|
15
|
-
ironpress-core = { version = "=1.5.
|
|
15
|
+
ironpress-core = { version = "=1.5.4", package = "ironpress" }
|
|
16
16
|
magnus = "0.7"
|
|
17
17
|
rb-sys = { version = "0.9", default-features = false, features = ["stable-api-compiled-fallback"] }
|
data/lib/ironpress/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ironpress
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Gaston Gouron
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rb_sys
|
|
@@ -42,7 +42,9 @@ files:
|
|
|
42
42
|
homepage: https://github.com/gastongouron/ironpress
|
|
43
43
|
licenses:
|
|
44
44
|
- MIT
|
|
45
|
-
metadata:
|
|
45
|
+
metadata:
|
|
46
|
+
documentation_uri: https://gastongouron.github.io/ironpress/get-started/ruby/
|
|
47
|
+
source_code_uri: https://github.com/gastongouron/ironpress
|
|
46
48
|
post_install_message:
|
|
47
49
|
rdoc_options: []
|
|
48
50
|
require_paths:
|