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

Api to get images? #7043

Closed
deepflame opened this issue Feb 29, 2016 · 2 comments
Closed

Api to get images? #7043

deepflame opened this issue Feb 29, 2016 · 2 comments

Comments

@deepflame
Copy link

Hi everyone,

pdf.js is great! Was just wondering what I need to do in order to get all images of a page in node.js .
Seems the API is not quite there yet?

Maybe you could give me a hint how to accomplish that.

Thanks a lot
Andreas

@yurydelendik
Copy link
Contributor

At the moment you have to use getOperatorList (see https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L1033 and SVG converter as example at https://github.com/mozilla/pdf.js/blob/master/examples/svgviewer/viewer.js#L39). There are multiple ways images might be stored in the PDF: as JPEG with or without mask, as PNG, as scanned pages, as a BW bitmap data and as a pattern, sometime might be split into small several pieces. Please find the type of images used in your files and process only needed operations from the operator list. Closing as answered. Recovering of the original images from the PDF has little value for the viewer, so as is this requirement is out-of-scope of this project.

@deepflame
Copy link
Author

Hi @yurydelendik , thank you so much for your detailed and really fast response. This is highly appreciated! Wish you a nice day ahead

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