benweet / stackedit

In-browser Markdown editor
https://stackedit.io/
Apache License 2.0
21.67k stars 2.72k forks source link

Tables in PDF Export Broken #1051

Open philip-ulrich opened 7 years ago

philip-ulrich commented 7 years ago

See title. Here is an example of the issue:

example

This happens on a page break in the middle of a table.

nypgand1 commented 7 years ago

Same here. Need Help.

mesutk commented 7 years ago

Having the same problem.

nullku7 commented 7 years ago

Confirmed that this issue still exists

benweet commented 6 years ago

Do you still have that in the v5?

jurchiks commented 6 years ago

Yes, I'm still having it in v5.3.0 of your https://stackedit.io/app . If it wasn't for this, and for the lack of TOC in v5, it would have been perfect.

benweet commented 6 years ago

A workaround is to use page breaks: <div class="page-break-after"></div>

@jurchiks in the v5 you can insert a Table of Contents in your template. Have a look at the "Styled HTML with TOC" template for a concrete example.

jurchiks commented 6 years ago

That TOC is not the same, I want my TOC to be below the main header and a couple other things, but that template does not allow putting TOC inside content.

Page breaks are useless if you can't see each page in the preview. If you have to generate the PDF and fix every page after that, it's too much work that you have to do every time you change something. I'd rather use wkhtmltopdf to generate the PDF from your HTML, but this is also broken - the PDF is huge and its contents can't be selected (this seems to be caused by woff fonts, which your stylesheet uses and wkhtmltopdf obviously prefers them; I will probably try to rip your stylesheet and remove the woff fonts from it to check if that fixes the generated PDF). As such, at the moment I have no good solution and I will probably be looking into other ways of generating HTML from markdown and afterwards wkhtmltopdf'ing the result.

jurchiks commented 6 years ago

Update: removing woff fonts did fix both the huge file and the unselectable content problems, as well as the repeating table headers (wkhtmltopdf v0.12.2.4), but TOC requires more work.

amberP1 commented 6 years ago

I am using StackEdit for company documentation. Which need to exported to PDF. In PDF, 'StackEdit' in header and 'https://stackedit.io/app#' in footer show up. How could I get rid of them?

jacobq commented 6 years ago

@jurchiks Would you mind sharing how you worked around this problem / removed WOFF fonts? Did you just copy/paste the style.css file and delete all the @font-face entries?

jurchiks commented 6 years ago

I deleted the parts of the @font-faces that referred to .woff files.

jurchiks commented 6 years ago

Is the bug actually still prevalent? It's been 5 months already!

Jelkster commented 5 years ago

Confirmed this is still an issue.

svo commented 5 years ago

For anyone still suffering from this issue I added the following to a copy of the Styled HTML template to resolve the issue:

<style type="text/css">
    table { page-break-inside:auto }
    tr    { page-break-inside:avoid; page-break-after:auto }
    thead { display:table-header-group }
    tfoot { display:table-footer-group }
</style>
Nicicalu commented 2 years ago

For anyone still suffering from this issue I added the following to a copy of the Styled HTML template to resolve the issue:

<style type="text/css">
    table { page-break-inside:auto }
    tr    { page-break-inside:avoid; page-break-after:auto }
    thead { display:table-header-group }
    tfoot { display:table-footer-group }
</style>

This worked perfectly. Thank you!