fschutt / printpdf

A fully-featured PDF library for Rust, WASM-ready
https://fschutt.github.io/printpdf/
MIT License
829 stars 98 forks source link

Svg example no longer compiles #183

Closed qarmin closed 3 weeks ago

qarmin commented 2 months ago
cargo build --example svg  --features="svg"
error[E0432]: unresolved import `usvg::TreeParsing`
 --> src/svg.rs:7:5
  |
7 | use usvg::TreeParsing;
  |     ^^^^^^^^^^^^^^^^^ no `TreeParsing` in the root

error[E0425]: cannot find function `convert_tree_into` in crate `svg2pdf`
   --> src/svg.rs:108:14
    |
108 |     svg2pdf::convert_tree_into(&tree, svg2pdf::Options::default(), &mut writer, svg_id);
    |              ^^^^^^^^^^^^^^^^^ not found in `svg2pdf`

error[E0433]: failed to resolve: could not find `Options` in `svg2pdf`
   --> src/svg.rs:108:48
    |
108 |     svg2pdf::convert_tree_into(&tree, svg2pdf::Options::default(), &mut writer, svg_id);
    |                                                ^^^^^^^ could not find `Options` in `svg2pdf`
    |
help: consider importing this struct
    |
4   + use usvg::Options;
    |
help: if you import `Options`, refer to it directly
    |
108 -     svg2pdf::convert_tree_into(&tree, svg2pdf::Options::default(), &mut writer, svg_id);
108 +     svg2pdf::convert_tree_into(&tree, Options::default(), &mut writer, svg_id);
    |

warning: unexpected `cfg` condition value: `clippy`
   --> src/lib.rs:314:28
    |
314 | #![cfg_attr(all(not(test), feature = "clippy"), warn(result_unwrap_used))]
    |                            ^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `annotations`, `dds`, `default`, `embedded_images`, `font_subsetting`, `hdr`, `ico`, `image`, `js-sys`, `less-optimization`, `log`, `logging`, `pdf-writer`, `rayon`, `svg`, `svg2pdf`, `tga`, `usvg`, and `webp`
    = help: consider adding `clippy` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

Some errors have detailed explanations: E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0425`.
warning: `printpdf` (lib) generated 1 warning
error: could not compile `printpdf` (lib) due to 3 previous errors; 1 warning emitted
qarmin commented 3 weeks ago

No longer valid, because file no longer exist