mkdocs-pdf-export-plugin icon indicating copy to clipboard operation
mkdocs-pdf-export-plugin copied to clipboard

Empty page prepended to pdf output

Open nihiluis opened this issue 5 years ago • 9 comments

I have a test.md with this content: https://jaspervdj.be/lorem-markdownum/markdown.txt

the pdf export prepends one empty site to the actual page.

I'm using the material theme and downloaded mkdocs today. is this a known issue? can someone please check if it appears for him as well?

nihiluis avatar Aug 19 '20 14:08 nihiluis

I have the same problem. I don't have a solution at the moment. If you find one, please post.

codetricity avatar Aug 27 '20 23:08 codetricity

Checkout mkdocs-print-site-plugin as an alternative. Full disclosure: I'm the author.

timvink avatar Sep 07 '20 14:09 timvink

Issue seems to be that you don't have an index.md file. Adding one will populate the first page.

m09 avatar Dec 07 '20 09:12 m09

@m09 I can reproduce this bug, even with one single markdown file called index.md.

Here's the longest markdown file which gets converted to a single page pdf on my computer:

# Just a title

1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A # Just one page

Here's the shortest markdown file which gets converted to 2-pages pdf, with a blank first page:

# Just a title

1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A
1. A # Just one page
1. A # 2 pages, with first page empty.

Here are the resulting pdfs : index_just_one_page.pdf & index_two_pages.pdf.

If it helps, the corresponding mkdocs.yml is:

site_name: PDF Test
theme:
  name: material

plugins:
  - pdf-export:
      media_type: print

And requirements.txt is:

Babel==2.9.0
beautifulsoup4==4.9.3
cairocffi==1.2.0
CairoSVG==2.5.0
cffi==1.14.4
click==7.1.2
cssselect2==0.4.1
defusedxml==0.6.0
future==0.18.2
gitdb==4.0.5
GitPython==3.1.11
html5lib==1.1
htmlmin==0.1.12
importlib-metadata==3.3.0
Jinja2==2.11.2
joblib
jsmin==2.2.2
livereload==2.6.3
lunr==0.5.8
Markdown==3.3.3
markdown-inline-graphviz-extension==1.1
MarkupSafe==1.1.1
mkdocs==1.1.2
mkdocs-awesome-pages-plugin==2.5.0
mkdocs-git-revision-date-localized-plugin==0.8
mkdocs-localsearch==0.7.0
mkdocs-markdownextradata-plugin==0.2.0
mkdocs-material==6.2.3
mkdocs-material-extensions==1.0.1
mkdocs-minify-plugin==0.3.0
mkdocs-pdf-export-plugin==0.5.8
nltk==3.5
Pillow==8.0.1
pycparser==2.20
Pygments==2.7.3
pymdown-extensions==8.1
Pyphen==0.10.0
pytz==2020.5
PyYAML==5.3.1
regex==2020.11.13
six==1.15.0
smmap==3.0.4
soupsieve==2.1
tinycss2==1.1.0
tornado==6.1
tqdm==4.55.0
WeasyPrint==52.2
webencodings==0.5.1
zipp

On Linux Mint 19.3.

EricDuminil avatar Jan 01 '21 11:01 EricDuminil

I have the same problem. I don't have a solution at the moment.Anybody know? Please share your solutions

zhanenkui avatar Jan 28 '21 06:01 zhanenkui

If I select all the text in one of those seemingly empty pages, I actually find a link saying Skip to content.

pingvinen avatar Aug 17 '21 13:08 pingvinen

Any updates to this? Same issue here - I also found if you select all the white space you can see Skip to content. Then, if you hover over the invisible words, it hyperlinks to the next page.

It seems that this is a table of contents in the PDF... but with no formatting.

timd19 avatar Sep 21 '21 16:09 timd19

If you are using mkdocs-material I've fork and made my own plugin without using weasyprint but pyppeteer. I have got better results and more control over the exported files. However I do not support combined for now.

brospars avatar Sep 23 '21 15:09 brospars