htmlcsspdfhtml2pdfhtml-to-pdf

convert html to pdf - page break splits text


I tried to generate a PDF-file from a HTML/CSS-document by using the api of pdflayer.com. So far so good. everything worked fine. But there is one issue. If there is a page break, a line sometimes gets split like in the photo:

split line

is there a way to get rid of this issue? I also tried html2pdfrocket.com it is the same there.

The text is placed within this html-construct:

<html>
 <body>
  <div class="overall">
   <div class="content">
    <div class="wrapper">
     <div class="article">
      Text

Solution

  • I found out that there exists a problem with compiling the content inside of multiple divs. CSS-rules did not affect the behaviour of the issue.

    So I had an idea and what I made was to generate a "raw-html-output". In this html document is only

    <html>
     <head>
      <style>
       The only necessary css-rules.
      </style>
     </head>
     <body>
      Some text here.
     </body>
    </html>
    

    Nothing more.

    The API grabs the data from the simplyfied html-file and compiles them well.