Skip to content

Formatting issue when trying to export PDF with Firefox #56

Description

@tsde

Hello,

First, thank you for this useful plugin. I noticed that printing with Firefox adds an extraneous blank page. I can easily reproduce this behavior while using the basic mkdocs example generated with mkdocs new.

Steps to repoduce

  • mkdocs new test-site && cd test-site
  • Add the print-site plugin, material theme and index.md to the nav property (See my mkdocs.yml file below)
  • mkdocs serve (or mkdocs build and expose through nginx - same behavior)
  • Go to http://127.0.0.1:8000/print_page/ and hit Ctrl+P
  • See attached screenshot
    print_site_firefox

My mkdocs.yml file:

site_name: My Docs

plugins:
  - search
  - print-site

theme:
  name: material

nav:
  - index.md

I also noticed another thing that may be related to the behavior described above.When adding another page to the nav property, sometimes (quite randomly), the last h2 title of the page gets stripped out from the PDF export while the output of the /print_page/ is correctly rendered via http.

See here, you can see that the last title (2.7) is correctly rendered while browsing the /print_page/ endpoint
ok_http

However it gets stripped out from the PDF export:
ko_pdf

The last thing I noticed in the PDF export is that all links in the TOC refers to the URL of the website version of the docs instead of being simple anchors to the PDF titles but maybe that is the intended behavior. See here:
toc

Environment:

  • Ubuntu 20.04
  • Firefox 92
  • mkdocs 1.2.2
  • mkdocs-material 7.3.0
  • mkdocs-print-site-plugin 2.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions