Giter Club home page Giter Club logo

Comments (7)

GjjvdBurg avatar GjjvdBurg commented on June 8, 2024

Hi @sirupsen, thanks for the bug reports! Yes, performance is a bit of an issue. The majority of the time is spent on cropping the pages of the pdf to remove excess white space. After some profiling it seems that the expensive part of that operation is creating an image of a pdf page using the pdfplumber package and I don't see a way to avoid that (the reason this is done in Python at all is that the bounding box returned by pdfcrop isn't very accurate (4cb3af8)).

I did just push a commit (a2e833a) that speeds up using the --center flag, but you don't use that in your example.

Alternatively, I could add a --no-crop flag, which would speed up the process but lead to less nice results. Would that help?

from paper2remarkable.

sirupsen avatar sirupsen commented on June 8, 2024

Might it be possible to remove whitespace without converting to an image first? πŸ‘‚

from paper2remarkable.

GjjvdBurg avatar GjjvdBurg commented on June 8, 2024

I'm not sure, it might be necessary to render the pdf to figure out what the page looks like. That said, there is a pdfparser package that links directly to libpoppler, which seems a lot faster but is not a drop-in replacement for the current method with pdfplumber. I'll look into this a bit more and see what I can do.

from paper2remarkable.

GjjvdBurg avatar GjjvdBurg commented on June 8, 2024

@sirupsen Thanks again for reporting this issue! I've just pushed some changes that give about an 8x speedup. I'll prepare a new release of the package soon.

from paper2remarkable.

sirupsen avatar sirupsen commented on June 8, 2024

Excellent!!! I’ll upgrade as soon as it’s released.

I do think a no crop flag would be useful. Some may prefer to have tools (change pen, highlight, etc) visible at all times β€” or perhaps the crop could leave just enough space to always have the tools available on the left side?

from paper2remarkable.

GjjvdBurg avatar GjjvdBurg commented on June 8, 2024

I do think a no crop flag would be useful. Some may prefer to have tools (change pen, highlight, etc) visible at all times β€” or perhaps the crop could leave just enough space to always have the tools available on the left side?

Try version 0.5.4, both a --no-crop and a --right option are now available! :)

from paper2remarkable.

sirupsen avatar sirupsen commented on June 8, 2024

😍

from paper2remarkable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.