pdf-rs / pdf_render

MIT License
104 stars 21 forks source link

Unable to run pdf2image #18

Closed RudolfVonKrugstein closed 1 year ago

RudolfVonKrugstein commented 1 year ago

When I am doing "cargo run" in the examples/pdf2image directory, I get:

error[E0277]: the trait bound `pdf::file::File<Vec<u8>, NoCache, NoCache, NoLog>: Resolve` is not satisfied
  --> examples/pdf2image/src/main.rs:40:31
   |
40 |     render_page(&mut backend, &file, &page, Transform2F::from_scale(opt.dpi / 25.4))?;
   |     -----------               ^^^^^ the trait `Resolve` is not implemented for `pdf::file::File<Vec<u8>, NoCache, NoCache, NoLog>`
   |     |
   |     required by a bound introduced by this call
   |
   = help: the trait `Resolve` is implemented for `NoResolve`
note: required by a bound in `render_page`
  --> /home/nathan/projects/external/pdf-rs/pdf_render/render/src/lib.rs:81:63
   |
81 | pub fn render_page(backend: &mut impl Backend, resolve: &impl Resolve, page: &Page, transform: Transform2F) -> Result<Transform2F, PdfError> {
   |                                                               ^^^^^^^ required by this bound in `render_page`

For more information about this error, try `rustc --explain E0277`.
warning: `pdf2image` (bin "pdf2image") generated 1 warning
error: could not compile `pdf2image` (bin "pdf2image") due to previous error; 1 warning emitted

am I compiling it wrong? But this error should be independent of that ...

s3bk commented 1 year ago

Should be fixed now. But something in pathfinder is broken, it does not run.

s3bk commented 1 year ago

fixed https://github.com/s3bk/pathfinder_rasterize It is working again.

RudolfVonKrugstein commented 1 year ago

You are fast!