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

Feature request: Add getAnnots to NodePopplerPage #28

Open
itsachen opened this issue Mar 5, 2019 · 0 comments
Open

Feature request: Add getAnnots to NodePopplerPage #28

itsachen opened this issue Mar 5, 2019 · 0 comments

Comments

@itsachen
Copy link

itsachen commented Mar 5, 2019

Hi,

I'm trying to use poppler-simple to do some light PDF validation work. Specifically, I want to determine if a PDF contains annotations of a certain subtype.

I noticed that the library exposes some annotation methods/data but I'm looking for functionality similar to getAnnots exposed by poppler. It looks like that method returns a collection of Annots, each of which exposes some potentially useful information.

From a Node perspective, the method could return an array of objects:

import { PopperDocument } from 'poppler-simple';

const doc = new PopplerDocument(pathToSomeDocument);
const page = doc.getPage(pageNum);

const annots = page.getAnnots();
console.log(annots);
// [
//   {
//     ref: {
//       object: 270,
//       generation: 0
//     },
//     subtype: "Link"
//   },
//   {
//     ref: {
//       object: 210,
//       generation: 0
//     },
//     subtype: "FreeText"
//   },
// ]

Just curious what your thoughts were on this. If this sounds alright I could take a stab at this and put up a PR.

-Anthony

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

1 participant