pdf-rs / pdf_render

MIT License
112 stars 22 forks source link

Not compiling #20

Open soupslurpr opened 10 months ago

soupslurpr commented 10 months ago

Hi, I'm getting this when I'm trying to compile. Please help.

Caused by: failed to read C:\Users\user\projects\pathfinder_rasterize\Cargo.toml

soupslurpr commented 10 months ago

removing the patch lines, and cargo update, now getting:

error[E0433]: failed to resolve: use of undeclared crate or module `winit`
 --> C:\Users\user\.cargo\git\checkouts\pathfinder_view-e3bb902cdb8b6e4b\4c3b70b\src\view.rs:3:9
  |
3 | pub use winit::{event::{ElementState, KeyEvent}, keyboard::{ModifiersState, KeyCode}};
  |         ^^^^^ use of undeclared crate or module `winit`

error[E0412]: cannot find type `Emitter` in this scope
  --> C:\Users\user\.cargo\git\checkouts\pathfinder_view-e3bb902cdb8b6e4b\4c3b70b\src\view.rs:33:51
   |
33 |     fn init(&mut self, ctx: &mut Context, sender: Emitter<Self::Event>) {}
   |                                                   ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Emitter` in this scope
  --> C:\Users\user\.cargo\git\checkouts\pathfinder_view-e3bb902cdb8b6e4b\4c3b70b\src\view.rs:41:51
   |
41 |     fn init(&mut self, ctx: &mut Context, sender: Emitter<Self::Event>) {
   |                                                   ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Backend` in this scope
  --> C:\Users\user\.cargo\git\checkouts\pathfinder_view-e3bb902cdb8b6e4b\4c3b70b\src\lib.rs:92:14
   |
92 |     backend: Backend,
   |              ^^^^^^^ not found in this scope

error[E0412]: cannot find type `Backend` in this scope
  --> C:\Users\user\.cargo\git\checkouts\pathfinder_view-e3bb902cdb8b6e4b\4c3b70b\src\lib.rs:97:41
   |
97 |     pub fn new(config: Config, backend: Backend) -> Self {
   |                                         ^^^^^^^ not found in this scope

   Compiling globalcache v0.2.2
   Compiling globalcache v0.2.2 (https://github.com/s3bk/cachelib#cb512b9b)
Some errors have detailed explanations: E0412, E0433.                                                                                                
For more information about an error, try `rustc --explain E0412`.
error: could not compile `pathfinder_view` (lib) due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
s3bk commented 10 months ago

you need to add windows support to pathfinder_view. I only use linux, so i cant test that.

soupslurpr commented 10 months ago

Is pdf_render necessary for converting a pdf to svg or can I just use https://github.com/pdf-rs/pdf? I want to try that

s3bk commented 10 months ago

pdf_render is required, but not pdf_view. if you cd into the render directory it should build.

soupslurpr commented 10 months ago

when I run cargo run in the render directory it says there are no bins to run

s3bk commented 10 months ago

That is correct. It is a library.

s3bk commented 10 months ago

You can move view/src/bin/convert.rs into a separate crate. It does not depend on the view crate.

s3bk commented 10 months ago

I should note that the SVG and PDF generated contain the text as outlines, so they are quite large.

soupslurpr commented 10 months ago

Hmm ok thanks. I'll try that.

boredsquirrel commented 6 months ago

those are 2 issues, right? It is pretty confusing.

Is that a dependency of servos pathfinder?

git@github.com:servo/pathfinder.git