Skip to content

Commit

Permalink
format and sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
saraswatpuneet committed Oct 19, 2024
1 parent b763470 commit c2bc041
Show file tree
Hide file tree
Showing 8 changed files with 11,703 additions and 7,007 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ debug = true
adobe-cmap-parser = "0.4.1"
encoding_rs = "0.8.34"
euclid = "0.20.5"
lopdf = {version = "0.32", default-features = false, features = ["nom_parser"]}
lopdf = {version = "0.33", default-features = false, features = ["nom_parser"]}
postscript = "0.14"
type1-encoding-parser = "0.1.0"
unicode-normalization = "0.1.19"
Expand Down
19 changes: 11 additions & 8 deletions examples/extract.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
extern crate pdf_extract;
extern crate lopdf;
extern crate pdf_extract;

use lopdf::*;
use pdf_extract::*;
use std::env;
use std::path::PathBuf;
use std::path;
use std::io::BufWriter;
use std::fs::File;
use pdf_extract::*;
use lopdf::*;
use std::io::BufWriter;
use std::path;
use std::path::PathBuf;

fn main() {
//let output_kind = "html";
Expand All @@ -21,13 +21,16 @@ fn main() {
let mut output_file = PathBuf::new();
output_file.push(filename);
output_file.set_extension(&output_kind);
let mut output_file = BufWriter::new(File::create(output_file).expect("could not create output"));
let mut output_file =
BufWriter::new(File::create(output_file).expect("could not create output"));
let doc = Document::load(path).unwrap();

print_metadata(&doc);

let mut output: Box<dyn OutputDev> = match output_kind.as_ref() {
"txt" => Box::new(PlainTextOutput::new(&mut output_file as &mut dyn std::io::Write)),
"txt" => Box::new(PlainTextOutput::new(
&mut output_file as &mut dyn std::io::Write,
)),
"html" => Box::new(HTMLOutput::new(&mut output_file)),
"svg" => Box::new(SVGOutput::new(&mut output_file)),
_ => panic!(),
Expand Down
4,283 changes: 4,266 additions & 17 deletions src/core_fonts.rs

Large diffs are not rendered by default.

Loading

0 comments on commit c2bc041

Please sign in to comment.