aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmulator0002020-09-26 21:27:04 +0200
committerEmulator0002020-09-26 21:27:04 +0200
commit9c7a675498ed4d83a924e963cf9a610116e6db7e (patch)
tree5107133dfe19fb217e3e5a475c96584a5e04ee8b
parentd027a1401f32f2f5a3c37860fb3c9524b594f9dd (diff)
downloadpdf_form-9c7a675498ed4d83a924e963cf9a610116e6db7e.tar.bz2
Bugfix on appearance operators and some font values
-rw-r--r--src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b7cc588..7c215ee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -481,7 +481,7 @@ impl Form {
.map(|object| {
object
.as_f64()
- .unwrap_or(object.as_i64().unwrap_or(0) as f64)
+ .unwrap_or(object.as_i64().unwrap_or(0) as f64) as f32
})
.collect::<Vec<_>>();
@@ -500,7 +500,7 @@ impl Form {
// Ignored operators
let ignored_operators = vec![
- "bt", "tc", "tw", "tz", "g", "tr", "tf", "tj", "et", "q", "bmc", "emc",
+ "bt", "tc", "tw", "tz", "g", "tm", "tr", "tf", "tj", "et", "q", "bmc", "emc",
];
// Remove these ignored operators as we have to generate the text and fonts again
@@ -553,8 +553,8 @@ impl Form {
]);
// Calcolate the text offset
- let x = 3.0; // Suppose this fixed offset as we should have known the border here
- let y = 0.5 * (rect[3] - rect[1]) - 0.4 * font_size as f64; // Formula picked up from Poppler
+ let x = 2.0; // Suppose this fixed offset as we should have known the border here
+ let y = 0.5 * (rect[3] - rect[1]) - 0.4 * font_size as f32; // Formula picked up from Poppler
// Set the text bounds, first are fixed at "1 0 0 1" and then the calculated x,y
content.operations.append(&mut vec![Operation::new(