christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 264 forks source link

Page break does not work in production #263

Closed ItaiYuda closed 2 years ago

ItaiYuda commented 2 years ago

Hi,

I am trying to set a page break in a pdf A4 page.

My options:

let options = {
    html,
    width: 595,
    height: 842,
    fileName: ...myFileName,
    directory: 'Documents'
};

I added a class with page break properties to the html style and added the class before the Weather section div:

.page-break-before {
    display: block;
    page-break-before: always; 
    page-break-after: auto;
    page-break-inside: avoid;
}

when I generate the pdf, in the dev environment everything works as expected:

(The page break should appear before the Weather section)

image

but in production, the page break doesn't seem to work:

image

OS

It occurs on Android only.

Environment

"react-native-html-to-pdf": "0.11.0",
"react": "17.0.2",
"react-native": "0.64.2",
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.