danfickle / danfickle/openhtmltopdf
NPE for TableBox class - margin from top
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 423
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I´m getting a Nullpointer Exception inside this.
The problem is the table and the margin to the top.
Class: public class **TableBox**

This code is working:
`
Vorschau
@page {
size: A4 portrait;
margin-top: 58.993881175677mm;
margin-bottom: 49.998047853676994mm;
margin-left: 0mm;
margin-right: 0mm;
background-color:#ffffff; color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:10.0px;font-weight:normal;font-style:normal;;
@top-right {
content: element(headerPageNext);
}
@bottom-right {
content: element(footerPageNext);
}
}
.headerPageNext {
position: running(headerPageNext);
}
.footerPageNext {
position: running(footerPageNext);
display: block;
}
.pageFirstSetting {
font-size: 10.0pt !important;
font-family: Arial, Helvetica, sans-serif !important;
color: #000000 !important;
}
.contentPageNext {
position: absolute;
}
table {
-fs-table-paginate: paginate;
border-spacing: 0;
}
thead {
display: table-header-group;
}
tfoot {
display: table-header-group;
}
#pagenumber:before {
content: counter(page);
}
#pagecount:before {
content: counter(pages);
}
`
If I change the margin from top from the table a little bit more, than I got this NPE.
**HTML Code:**
`
Vorschau
@page {
size: A4 portrait;
margin-top: 58.993881175677mm;
margin-bottom: 49.998047853676994mm;
margin-left: 0mm;
margin-right: 0mm;
background-color:#ffffff; color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:10.0px;font-weight:normal;font-style:normal;;
@top-right {
content: element(headerPageNext);
}
@bottom-right {
content: element(footerPageNext);
}
}
.headerPageNext {
position: running(headerPageNext);
}
.footerPageNext {
position: running(footerPageNext);
display: block;
}
.pageFirstSetting {
font-size: 10.0pt !important;
font-family: Arial, Helvetica, sans-serif !important;
color: #000000 !important;
}
.contentPageNext {
position: absolute;
}
table {
-fs-table-paginate: paginate;
border-spacing: 0;
}
thead {
display: table-header-group;
}
tfoot {
display: table-header-group;
}
#pagenumber:before {
content: counter(page);
}
#pagecount:before {
content: counter(pages);
}
`
Is this a known bug?
My dependencies:
```
org.xhtmlrenderer
flying-saucer-pdf
9.1.22
com.openhtmltopdf
openhtmltopdf-core
1.0.10
com.openhtmltopdf
openhtmltopdf-pdfbox
1.0.10
com.openhtmltopdf
openhtmltopdf-objects
1.0.10
```
I´m pretty sure it was working in the past with an older version. Has been there something changed?
It´s currently a huge bug, because the whole PDF is not rendering now
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.