Skip to content

Commit

Permalink
Corrected Documentation to include JPG/PNG images as supported types
Browse files Browse the repository at this point in the history
  • Loading branch information
SaudQureshi1997 committed Oct 21, 2020
1 parent d1ec029 commit c7bc572
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Currently, printpdf can only create new documents and write them, it cannot load
- Page generation
- Layers (Illustrator like layers)
- Graphics (lines, shapes, bezier curves)
- Images (currently BMP only or generate your own images)
- Images (currently BMP/JPG/PNG only or generate your own images)
- Embedded fonts (TTF and OTF) with Unicode support
- Advanced graphics - overprint control, blending modes, etc.
- Advanced typography - character scaling, character spacing, superscript, subscript, outlining, etc.
Expand Down Expand Up @@ -135,7 +135,7 @@ fn main() {
let (doc, page1, layer1) = PdfDocument::new("PDF_Document_title", Mm(247.0), Mm(210.0), "Layer 1");
let current_layer = doc.get_page(page1).get_layer(layer1);

// currently, the only reliable file format is bmp (jpeg works, but not in release mode)
// currently, the only reliable file formats are bmp/jpeg/png
// this is an issue of the image library, not a fault of printpdf
let mut image_file = File::open("assets/img/BMP_test.bmp").unwrap();
let image = Image::try_from(image::bmp::BmpDecoder::new(&mut image_file).unwrap()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
let (doc, page1, layer1) = PdfDocument::new("printpdf graphics test", Mm(210.0), Mm(297.0), "Layer 1");
let current_layer = doc.get_page(page1).get_layer(layer1);

// currently, the only reliable file format is bmp (jpeg works, but not in release mode)
// currently, the only reliable file formats are bmp/jpeg/png
// this is an issue of the image library, not a fault of printpdf

let image_bytes = include_bytes!("../assets/img/BMP_test.bmp");
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! - Page generation
//! - Layers (Illustrator like layers)
//! - Graphics (lines, shapes, bezier curves)
//! - Images (currently BMP only or generate your own images)
//! - Images (currently BMP/PNG/JPG only or generate your own images)
//! - Embedded fonts (TTF and OTF) with Unicode support
//! - Advanced graphics - overprint control, blending modes, etc.
//! - Advanced typography - character scaling, character spacing, superscript, subscript, outlining, etc.
Expand Down Expand Up @@ -131,7 +131,7 @@
//! let (doc, page1, layer1) = PdfDocument::new("PDF_Document_title", Mm(247.0), Mm(210.0), "Layer 1");
//! let current_layer = doc.get_page(page1).get_layer(layer1);
//!
//! // currently, the only reliable file format is bmp (jpeg works, but not in release mode)
//! // currently, the only reliable file formats are bmp/jpeg/png
//! // this is an issue of the image library, not a fault of printpdf
//! let mut image_file = File::open("assets/img/BMP_test.bmp").unwrap();
//! let image = Image::try_from(image::bmp::BmpDecoder::new(&mut image_file).unwrap()).unwrap();
Expand Down

0 comments on commit c7bc572

Please sign in to comment.