use pdf_composer::{
FontsStandard, PDFComposer, PDFComposerStruct, PDFDocInfoEntry, PDFVersion, PaperOrientation,
PaperSize,
};
use std::path::PathBuf;
fn main() {
println!("Basic example");
let mut bob: PDFComposerStruct = PDFComposer::new();
let paths = vec![
PathBuf::from("examples/basic/sample_mds/sample_file_01.md"),
PathBuf::from("examples/basic/sample_mds/sample_file_02.md"),
PathBuf::from("examples/basic/sample_mds/file_not_found.md"),
PathBuf::from("examples/basic/sample_mds/untitled.txt"),
];
bob.add_source_files(paths);
bob.set_pdf_version(PDFVersion::V2_0);
bob.set_output_directory("examples/basic/output_pdfs_a6");
bob.set_paper_size(PaperSize::A6);
bob.set_orientation(PaperOrientation::Landscape);
bob.set_margins("20");
bob.set_font(FontsStandard::TimesRoman);
let author_entry = PDFDocInfoEntry {
doc_info_entry: "Author",
yaml_entry: "author",
};
let keywords_entry = PDFDocInfoEntry {
doc_info_entry: "Keywords",
yaml_entry: "keywords",
};
let subject_entry = PDFDocInfoEntry {
doc_info_entry: "Subject",
yaml_entry: "description",
};
let language_entry = PDFDocInfoEntry {
doc_info_entry: "Language",
yaml_entry: "language",
};
let random_entry = PDFDocInfoEntry {
doc_info_entry: "Random",
yaml_entry: "random",
};
bob.set_doc_info_entry(author_entry);
bob.set_doc_info_entry(keywords_entry);
bob.set_doc_info_entry(random_entry);
bob.set_doc_info_entry(subject_entry);
bob.set_doc_info_entry(language_entry);
bob.generate_pdfs();
}