Skip to content

Conversation

@edoardocavazza
Copy link
Contributor

Some marked contents have a Lang attribute defined in the props passed to the beginMarkedContentProps operator. With this PR, the evaluator extracts this information. I chose to pass the props object as third argument in order to maintain backwards compatibility, but I'm open to changes.

const pdfDoc = await loadingTask.promise;
const pdfPage = await pdfDoc.getPage(1);

pdfDoc.annotationStorage.setValue("30R", { value: "test" });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no annotations in the pdf so I don't see the point of setting these values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh I am sorry, bad copy/paste from a previous test. Removed

const opList = await pdfPage.getOperatorList({
annotationMode: AnnotationMode.DISABLE,
});
expect(opList.fnArray[0]).toEqual(OPS.beginMarkedContentProps);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it useful to get the lang parameter in the operator list which is used to draw the pdf ?

@calixteman
Copy link
Contributor

Could you rebase your patch ?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants