Skip to content
This repository was archived by the owner on Jul 11, 2024. It is now read-only.
This repository was archived by the owner on Jul 11, 2024. It is now read-only.

Supressing errors that are generated when processing #23

Description

@thesmithee

Hi,

I am using PyPDF3 to extract metadata from a bunch of PDF files I have on my drive. It is working pretty well, but I am running into an issue that it keeps outputting stuff to STDOUT like below:

invalid pdf header: b'Comun'
incorrect startxref pointer(3)

I understand that the error is raised because there are errors in the PDF file that is being parsed, and that is fine.

What I've tried:

  1. Passing strict=False to PdfReader object at construction time. According to PdfReader docs it is already False by default, but I thought it couldn't hurt.
  2. Setting the logging levels for the PyPDF2 logger as explained in the documentation.

None of the two things worked, so I'm a bit at a loss of how to stop these errors (or log them to a different place).

Does someone have a way how to do this that works? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions