Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Mar 30, 2024
1 parent 7cb474e commit 763408b
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ will still be turned into a vector graphic), so no quality is lost.
This example reads an SVG file and writes the corresponding PDF back to the disk.
```
* # fn main() -> Result<(), Box<dyn std::error::Error>> {
* use svg2pdf::usvg::fontdb;
* use svg2pdf::ConversionOptions;
*
* let input = "tests/svg/custom/integration/matplotlib/stairs.svg";
* let output = "target/stairs.pdf";
*
* let svg = std::fs::read_to_string(input)?;
* let options = svg2pdf::usvg::Options::default();
* let mut db = fontdb::Database::new();
* db.load_system_fonts();
* let tree = svg2pdf::usvg::Tree::from_str(&svg, &options, &db)?;
*
* let pdf = svg2pdf::to_pdf(&tree, Options::default(), &db);
* std::fs::write(output, pdf)?;
* # Ok(()) }
* ```
# fn main() -> Result<(), Box<dyn std::error::Error>> {
use svg2pdf::usvg::fontdb;
use svg2pdf::Options;
let input = "tests/svg/custom/integration/matplotlib/stairs.svg";
let output = "target/stairs.pdf";
let svg = std::fs::read_to_string(input)?;
let options = svg2pdf::usvg::Options::default();
let mut db = fontdb::Database::new();
db.load_system_fonts();
let tree = svg2pdf::usvg::Tree::from_str(&svg, &options, &db)?;
let pdf = svg2pdf::to_pdf(&tree, Options::default(), &db);
std::fs::write(output, pdf)?;
# Ok(()) }
```
## Supported features
In general, a very large part of the SVG specification is supported, including
Expand Down

0 comments on commit 763408b

Please sign in to comment.