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

ParsingError: Optional Content PDF - with some PDF files uploaded #230

Open
MatteoVella opened this issue Sep 19, 2023 · 5 comments
Open

Comments

@MatteoVella
Copy link

After uploading some PDF files, during the process of combining two pdfs, the process crashes and returns the following error:

CombinePDF::ParsingError: Optional Content PDF files aren't supported and their pages cannot be safely extracted.

I attach below one of the files that returned the error:
pdf_test.pdf

While other PDF files like the following completed the process without any errors:
pdf_test_2.pdf

What could the error be related to?

@MatteoVella
Copy link
Author

Hi @boazsegev, can you help me, please?

@MatteoVella
Copy link
Author

Hi @boazsegev, any news from this issue?

Let me know, thanks

@boazsegev
Copy link
Owner

Hi @MatteoVella

Did you try allowing optional content (see Known Limitations)?

filename = 'pdf_test.pdf'
CombinePDF.load(filename, allow_optional_content: true).

For me it works fine once that option is enabled.

@magnum
Copy link

magnum commented Dec 15, 2023

thank you @boazsegev
we're using both methods

CombinePDF.load

to load file from a local path
and

CombinePDF.parse

to load a file via http
can we use allow_optional_content: true with both methods?

@boazsegev
Copy link
Owner

Yes, the extra options are passed through to the parse method.

Essentially load is just parse with an IO.binread.

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

No branches or pull requests

3 participants