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

[BUG] Table of Contents Links Jump 11 Pages Ahead in PDF #2014

Closed
imudak opened this issue Jun 21, 2024 · 3 comments
Closed

[BUG] Table of Contents Links Jump 11 Pages Ahead in PDF #2014

imudak opened this issue Jun 21, 2024 · 3 comments
Assignees
Labels

Comments

@imudak
Copy link

imudak commented Jun 21, 2024

Description

When generating a PDF from a Markdown file using the Markdown Preview Enhanced (MPE) extension in VSCode, clicking on Table of Contents (TOC) links results in navigating to a position 11 pages ahead of the intended section.

Environment

  • OS: Windows 10
  • VSCode Version: 1.90.2
  • Markdown Preview Enhanced Version: 0.8.13

Steps to Reproduce

  1. Create the following Markdown file:

    # Title
    
    - [Section 1](#section-1)
    - [Section 2](#section-2)
    - [Section 3](#section-3)
    
    ## Section 1
    
    Content
    Content
    Content
    ...
    Content
    Content
    
    ## Section 2
    
    Content2
    
    ## Section 3
    
    Content3
  2. Generate the PDF using MPE in VSCode:

    • Go to Export -> Chrome (Puppeteer) -> PDF.
  3. Open the generated PDF and click on any TOC link.

Expected Behavior

Clicking on a TOC link should navigate to the corresponding section in the PDF.

Actual Behavior

Clicking on a TOC link navigates to a position 11 pages ahead of the intended section.

Additional Information

If the PDF does not contain at least 11 pages, clicking the TOC links causes the PDF to crash.

Request for Assistance

Please assist in resolving this issue. If any additional information is required, feel free to contact me.

@imudak
Copy link
Author

imudak commented Jun 24, 2024

After downgrading Chrome from the latest version 126.0.6478.115 to 124.0.6367.61 on my PC, the issue no longer occurs. It seems there were some changes related to PDF handling in Chrome around version 126, which might be affecting this behavior.

@imudak
Copy link
Author

imudak commented Jun 27, 2024

It looks like fixes are progressing on the following issue in Chromium.

Page.printToPdf does not render anchor links [347674894] - Chromium

@imudak
Copy link
Author

imudak commented Jul 30, 2024

The duplicate issue is being discussed in #2021 and we would appreciate it if you could CLOSE this one.

@imudak imudak closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants