pdf-rs / pdf_render

MIT License
104 stars 21 forks source link

Conflicting packages when using with pdf from crate.io #22

Closed Dsantra92 closed 6 months ago

Dsantra92 commented 6 months ago

Tried running the pdf_text example, the cargo build fails pointing out that we are indeed using two different versions of the pdf package. The cargo tree traceback is as follows:

cargo tree --depth 3 | grep 'pdf' 

results in

├── pdf v0.9.0
│   ├── pdf_derive v0.2.0 (proc-macro)
└── pdf_text v0.1.0 (https://github.com/pdf-rs/pdf_text.git#03d4789b)
    ├── font v0.1.0 (https://github.com/pdf-rs/font#9aa9b821)
    │   ├── pdf_encoding v0.4.0
    ├── pdf v0.9.0 (https://github.com/pdf-rs/pdf#b06cfdf1)
    │   ├── pdf_derive v0.2.0 (proc-macro) (https://github.com/pdf-rs/pdf#b06cfdf1)
    ├── pdf_render v0.1.0 (https://github.com/pdf-rs/pdf_render#39a877d3)
    │   ├── font v0.1.0 (https://github.com/pdf-rs/font#9aa9b821) (*)
    │   ├── pdf v0.9.0 (https://github.com/pdf-rs/pdf#b06cfdf1) (*)
    │   ├── pdf_encoding v0.4.0 (*)

This can avoided by using mulitple locations feature for https://github.com/pdf-rs/pdf_render/blob/39a877d3dde5105ffff8f116a4dd5ae325c02867/Cargo.toml#L24

to

 pdf = { path = "../pdf/pdf", default-features=false, version = "0.9.0" }

I am very new to rust 🦀, please let me know if I missed anything.

s3bk commented 6 months ago

It looks to me that pdf_text use the git version. It could be changed, but pdf_text and pdf_render are fairly active and benefit from not being locked to a version on crates.io.

Dsantra92 commented 6 months ago

What is your suggestion for using pdf_render or pdf_text with pdf. I tried putting the correct rev to the Cargo.toml for pdf, but still sees it as a different library from the one install with pdf_render.

s3bk commented 6 months ago

just use pdf = { git = "https://github.com/pdf-rs/pdf" }