Closed bianbiandashen closed 1 week ago
Can you show your code and I can also work with you to build subsets? In addition, even if 0.8 activates this ability When adding_external_font, the cache capabilities should still need to be preserved, right?
You can use printpdf = { git = „https://github.com/fschutt/printpdf“ }
in your Cargo.toml and look at the examples, they have been updated for the new version. Only minor bugs with SVGs and layers need to be worked out, the rest is the same API.
I am mainly working on the HTML renderer in 0.8, so it will still take some time to release (since 0.8 is the biggest refactoring in 5+ years, I don‘t want to rush it, I guess end of November it‘ll be stable enough).
When adding_external_font, the cache capabilities should still need to be preserved, right?
In 0.8 it uses a unique FontId String instead of a Rust reference to identify where a font was used in the document:
let mut doc = PdfDocument::new(„title“);
let font = ParsedFont::from_bytes(BYTES).unwrap();
let fontid = doc.add_font(&font); // random string
Hi, my usage scenario is to draw PDF and print on Windows system, including win7/win10/win11. Does this code support the above systems?
When adding_external_font, the cache capabilities should still need to be preserved, right?
In 0.8 it uses a unique FontId String instead of a Rust reference to identify where a font was used in the document:
let mut doc = PdfDocument::new(„title“); let font = ParsedFont::from_bytes(BYTES).unwrap(); let fontid = doc.add_font(&font); // random string
Hi When I configure to download the code from git, the following error appears when running locally. My rust version is rustc 1.79.0 (129f3b996 2024-06-10)
Hi, my usage scenario is to draw PDF and print on Windows system, including win7/win10/win11. Does this code support the above systems?
Yes.
Hi When I configure to download the code from git, the following error appears when running locally. My rust version is rustc 1.79.0 (129f3b996 2024-06-10)
Please post the error.
Hi, my usage scenario is to draw PDF and print on Windows system, including win7/win10/win11. Does this code support the above systems?
Yes.
Hi When I configure to download the code from git, the following error appears when running locally. My rust version is rustc 1.79.0 (129f3b996 2024-06-10)
Please post the error.
error: unexpected token: `<-`
--> /Users/fangqiji/.cargo/git/checkouts/printpdf-ad3d01efe2a6c4c7/c03ca60/src/types/plugins/graphics/two_dimensional/line.rs:93:45
|
93 | operations.place_back() <- Operation::new(OP_PATH_PAINT_FILL_STROKE_CLOSE_NZ, vec![]);
| ^^
|
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
|
93 | operations.place_back() < - Operation::new(OP_PATH_PAINT_FILL_STROKE_CLOSE_NZ, vec![]);
| ~~~
@fangqi5 You are for some reason using a version c03ca60
, a printpdf version from July 2017. You don't need to download the code from git, just put this in your Cargo.toml:
printpdf = { git = "https://github.com/fschutt/printpdf", branch = "master" }
or:
printpdf = { git = "https://github.com/fschutt/printpdf", rev = "5109221b" } # todays commit
In 2017 the place_back() <-
notation was allowed on nightly, that's why it doesn't compile anymore.
@fangqi5 Next time, please don‘t blindly copy code (or in this case version numbers) from ChatGPT.
rev
I sincerely apologize. While my Cargo.toml file configuration aligns with what you provided, the absence of the "cargo clean" step resulted in downloading code that did not meet expectations.
Hi, I've come across issue #27 in the allsorts repository where subsetting fonts on Windows results in invalid font files. I'm wondering if there are any workarounds available for this issue?
@fangqi5 I am debugging the layout at the moment, it also seems that the kerning / layouting is off when using subset fonts... not sure why.
There is a great need for version 0.8 of printpdf to support font pumping technology. You should also use allsorts as a rust-based solution, right? There have been complaints that pdf is too big and will cause too long printing time.
Originally posted by @fschutt in https://github.com/fschutt/printpdf/issues/189#issuecomment-2452938099
0.8 Can I use it now? In addition, does the function of subset font also support windows?