-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[wip] Freetext annotation DA parsing #12093
Conversation
Reftests are currently busted. Every test failure seems to be one-digit-color off (e.g., Original Patched, broken (or at least different) in both Fx and Chromium: Original Patched, broken in Chromium: The latter definitely looks worse. I'm going to try to figure out what broke. |
src/core/annotation.js
Outdated
|
||
const opList = new OperatorList(); | ||
const appearanceStream = new Stream(stringToBytes(data.defaultAppearance)); | ||
const resourcesFonts = this.pdfManager.pdfDocument.catalog.fontCache.dict; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately #10122 (comment) still applies here, there's simply no way that this works correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried resolving this in e9ed30c . Does that look sane?
…ill be another patch)
…tion instead of Annotation
Hm, but I lost the freetext annotations in issue10122.pdf in b20af4a . |
}) | ||
.then(() => { | ||
const args = opList.argsArray; | ||
for (let i = 0, ii = opList.fnArray.length; i < ii; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the OperatorList
has a length
getter, it should be possible to simply use:
for (let i = 0, ii = opList.fnArray.length; i < ii; i++) { | |
for (let i = 0, ii = opList.length; i < ii; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OperatorList.length
appears to return this.argsArray.length
instead of this.fnArray.length
. Are they always the same length?
This will likely take some time. For instance, in chrome-tracemonkey-text-page7, there's a single pixel that's now Edit: found https://github.com/mozilla/pdf.js/wiki/Debugging-PDF.js |
Oh, there are currently some regression test failures in Chrome due to intermittent rendering differences in the Chrome engine. If it's only in Chrome and not in Firefox, it's most likely not a concern (at least, not caused by your code). For example, look at the test output comments at #12059. The patch does not contain functional changes, only refactoring, but in Chrome some tests fail because of this rendering engine problem since the last few Chrome versions. |
Ah, yes, the differences are all Chrome. Thanks! That saved me a lot of time. |
Rescuing changes from #10122 .
I got here from #11637 (comment) , which I think I got to from #7613 .