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

Empty page prepended to pdf output #89

Open
nihiluis opened this issue Aug 19, 2020 · 8 comments
Open

Empty page prepended to pdf output #89

nihiluis opened this issue Aug 19, 2020 · 8 comments

Comments

@nihiluis
Copy link

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?

@codetricity
Copy link

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

@timvink
Copy link
Contributor

timvink commented Sep 7, 2020

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

@m09
Copy link

m09 commented Dec 7, 2020

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

@EricDuminil
Copy link

EricDuminil commented Jan 1, 2021

@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.

@zhanenkui
Copy link

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

@pingvinen
Copy link

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

@timd19
Copy link

timd19 commented Sep 21, 2021

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.

@brospars
Copy link

brospars commented Sep 23, 2021

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.

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

No branches or pull requests

9 participants