-
Notifications
You must be signed in to change notification settings - Fork 10k
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 detect vector shapes in pdf pages #9728
Comments
Vector shapes are not one entity in PDF documents, but are instead composed of various operations, such as line drawing and filling (see https://github.com/mozilla/pdf.js/blob/master/src/shared/util.js#L174 for the list of existing operations), hence there is no easy way to extract vector shapes unfortunately. |
ok thanks , then how to just detect that page have vectors or not i tried something like
which not worked , then i just looped to see what inside
which output
and then i checked : https://github.com/mozilla/pdf.js/blob/master/src/shared/util.js#L174
as you can see my test pdf page 2 have one rectangle and circle so i was aspecting some rectange and circle codes any idea what am doing wrong |
In that case the rectangle and circle are drawn onto the annotation layer, which are already SVG elements. Refer to https://github.com/mozilla/pdf.js/blob/master/src/display/annotation_layer.js#L898-L938 for how they're drawn. |
Attach (recommended) or Link to PDF file here:
test4.pdf
Configuration:
i can detect text , images in pdf pages but do not know how to detect vector shapes , i checked wiki pages but no found any useful related to it
so any idea how to detect vectors in pdf that page have vectors or not , like the pdf i attached , page 1 have text , page 2 have vector shapes , and page 3 have image. so am stuck with page 2 vector shape detection that page have it or not .
examples
with page 1 to detect text am doing something like
with page 3 to detect images doing something like
page 2 .... problem
thanks
The text was updated successfully, but these errors were encountered: