Skip to content

Conversation

@aguadoenzo
Copy link

While the library expects a filepath to be given to the PdfConverter, the underlying pdfium.PdfDocument constructor supports bytes and other types. Adding 'bytes' as an accepted type for the Document Pydantic model allows binary PDFs to be parsed by the library.

I've tested this patch manually and things seem to work fine so far, but I'd prefer to add tests for it. However the test suite seems to be heavily built around creating a temporary file, and I'm not sure where to start to test this

While the library expects a filepath to be given to the
PdfConverter, the underlying pdfium.PdfDocument constructor
supports bytes and other types. Adding 'bytes' as an accepted
type for the Document Pydantic model allows binary PDFs to be
parsed by the library.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@aguadoenzo
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 5, 2024
VikParuchuri pushed a commit that referenced this pull request Dec 12, 2024
@AGenchev
Copy link

Shouldn't this be made by creating a new provider e.g. binary_data provider, cv2_image provider ?

@mauryaland
Copy link

Up, this feature could be very useful !

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.

3 participants