Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: pdfminer to fitz in convert#630 #685

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thinklab
Copy link
Collaborator

@thinklab thinklab commented Jun 8, 2023

closes #630

@thinklab thinklab requested a review from serereg June 8, 2023 08:44
@thinklab thinklab changed the title Feat/pdfminer to fitz in convert#630 perf: pdfminer to fitz in convert#630 Jun 8, 2023
@@ -101,3 +102,53 @@ def _create_neighbor_bbox(self, current_bbox: Bbox) -> Bbox:
new_x0, new_y0 = x1, y0
new_x1, new_y1 = (x1 - x0) + x1, y1
return new_x0, new_y0, new_x1, new_y1


class PlainPDFToBadgerdocTokensConverterPytz:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it is needed to replase PlainPDFToBadgerdocTokensConverter class by this one

self.offset = 0
self.page_size: Optional[PageSize] = None

def _convert_span(self, span): # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary to remove all type ignores. In order to simplify the process of determining types, you can add a breakpoint here and in debug mode, find out the type of this variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MAJOR] fitz should be much faster than pdfminer
2 participants