forked from mikeparisstuff/printpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efd300c
commit 9247223
Showing
7 changed files
with
83 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*extern crate grid; | ||
use grid::Grid; | ||
use crate::Mm; | ||
/// Set the way of column line offset calculation | ||
enum ColumnLineConfiguration<S: Into<String>> { | ||
/// Calculates automatically the column offset so that each columns width is equal to each other. | ||
/// The parameter is the amount of columns. | ||
/// - [ ] in progress | ||
Automatic(u8), | ||
/// Set the columns offset manually. | ||
/// The parameter is a List of the x-values started at the bottom left corner of the table | ||
/// - [ ] in progress | ||
Manually(Vec<Mm>), | ||
/// Calculates automatically the column offset based on the text written in the table | ||
/// The parameter contains a Grid with all text inputs in the table. | ||
/// If you want to have empty cells at the beginning of the table generation. | ||
/// Please use `Automatic` or `Manually` instead. | ||
/// - [ ] in progress | ||
ContentAdapting(Grid<S>), | ||
}*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/*use std::fs::File; | ||
use std::io::BufWriter; | ||
use printpdf::BuiltinFont; | ||
use printpdf::{Mm, PdfDocument, Point}; | ||
#[test] | ||
fn pdf_document_with_table() { | ||
let (document, page_index, layer_index) = PdfDocument::new("Rechnung", Mm(210.0), Mm(297.0), "Ebene"); | ||
let font = document.add_builtin_font(BuiltinFont::TimesRoman).unwrap(); | ||
let current_layer = document.get_page(page_index).get_layer(layer_index); | ||
current_layer.add_table(3, 10, Point::new(Mm(20.0), Mm(150.0)), Mm(100.0), Mm(100.0)); | ||
document.save(&mut BufWriter::new(File::create("test_table.pdf").unwrap())).unwrap(); | ||
}*/ |