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

TextLayer slightly misaligned #14176

Open
Vanessa219 opened this issue Oct 22, 2021 · 5 comments
Open

TextLayer slightly misaligned #14176

Vanessa219 opened this issue Oct 22, 2021 · 5 comments

Comments

@Vanessa219
Copy link

Vanessa219 commented Oct 22, 2021

Attach (recommended) or Link to PDF file here:

asymmetrically.pdf

Configuration:

  • Web browser and its version: Chrome 94.0.4606.81
  • Operating system and its version: MacOS 11.6
  • PDF.js version: The version was not found, it was generated by running gulp minified-legacy after updating from the master.
  • Is a browser extension: Yes

Steps to reproduce the problem:

  1. Open this PDF and scroll to A B S T R A C T
  2. Select and copy asymmetrically
  3. Paste the content as symmetrically

What is the expected behavior? (add screenshot)

Paste the content as asymmetrically

What went wrong? (add screenshot)

  1. textLayer and canvasWrapper are not aligned.
    image
Off-topic
  1. The page number in the input box is incorrect.
    image
@Snuffleupagus
Copy link
Collaborator

Configuration:
* Web browser and its version: The latest
* Operating system and its version: The latest
* PDF.js version: The latest
* Is a browser extension: Yes

None of this is useful, since "the latest" doesn't mean anything; you need to actually fill out this section properly with actual names and version numbers explicitly specified.


The page number in the input box is incorrect.

That's most definitely correct, see https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.1696265. (And if that were a bug, which it clearly isn't, you should always report one problem per issue.)

@Snuffleupagus Snuffleupagus changed the title Misaligned and page fault TextLayer slightly misaligned Oct 22, 2021
@Vanessa219
Copy link
Author

Thanks, updated.

@TazmanianDI
Copy link

Instead of creating another issue, I'll just add a comment with a second example and some more details. I tried on two different machines and 5 different browsers, all with the same results. I initially noticed this developing the pdf viewer on my own site but I was able to repro it using the version that is deployed at https://mozilla.github.io/pdf.js/web/viewer.html.

Repro:

  1. Use the attached PDF or download from https://pdfobject.com/pdf/pdf_open_parameters_acro8.pdf
  2. Visit https://mozilla.github.io/pdf.js/web/viewer.html
  3. Open the downloaded PDF from above.
  4. Use the find function to search for "this guide". The example here is the 7th match.

Operating system: Windows 10 22H2 19045.3448 and MacOS 13.6 (22G120)
Browser: Edge 117.0.2045.36 (Windows), Chrome 117.0.5938.92 (Both), Firefox 117.0.1 (Mac), Safari 16.6 (18615.3.12.11.2) (Mac)
Library version: 3.10.111
Is browser extension: no

pdf_open_parameters_acro8.pdf
image

@TazmanianDI
Copy link

Someone pointed out to me that this library is what is actually used as the built-in/native viewer in Firefox. So I tried opening the link to the PDF above directly in FF and it also shows the same misalignment problem. The Chrome viewer for comparison does not.

@Podginator

This comment was marked as off-topic.

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

No branches or pull requests

4 participants