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

How to check if a PDF page is blank? #275

Open
zorro-lp opened this issue Feb 21, 2023 · 8 comments
Open

How to check if a PDF page is blank? #275

zorro-lp opened this issue Feb 21, 2023 · 8 comments

Comments

@zorro-lp
Copy link

zorro-lp commented Feb 21, 2023

Hi. I want to check if a PDF page is blank. I start with looking into the result of pdfReader.parsePageDictionary(pageIndex).toJSObject().Resources.
I guess it is blank if pdfReader.parsePageDictionary(pageIndex).toJSObject().Resources.toJSObject().XObject is undefined but I am not sure. Please advise.
Thanks.

@julianhille
Copy link
Owner

Hey. What do you mean with blank?

  • a page without any element?
  • a page that seems to be blank to the eye? Ex. White page with a white box on it (invisible to the eye).

Just making sure we have the same understanding here.

@zorro-lp
Copy link
Author

Hi. I mean a page without any element.

@julianhille
Copy link
Owner

I am currently sick I'll have a look when healthy again

@julianhille
Copy link
Owner

Would you mind sending / adding a sample file, this does not work on the sample i've got here

@zorro-lp
Copy link
Author

zorro-lp commented Mar 2, 2023

blank.pdf

@julianhille
Copy link
Owner

julianhille commented Mar 7, 2023

you have a very valid point, i'm unable to find a way to say if a page is empty or not.
empty.pdf
look at this file with your snippet, this feels pretty odd.

@zorro-lp
Copy link
Author

zorro-lp commented Mar 8, 2023

Thanks anyway :)

@julianhille
Copy link
Owner

I maybe need to expose some c++ functionality which goes over the xobject or so. will take some time.

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

2 participants