title: Pdfkit Html to pdf not working as expected in python
body: <p>I am converting a html file to pdf using pdfkit library in python. </p>
  
  <p>This is what my page looks like in html </p>
  
  <p><a href="https://i.stack.imgur.com/dgpIn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dgpIn.png" alt="enter image description here"></a></p>
  
  <p>And this is what I get after converting it to pdf. It puts "Summary" in the next line, but I want it in the same line.</p>
  
  <p><a href="https://i.stack.imgur.com/rqBnT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rqBnT.png" alt="enter image description here"></a></p>
  
  <p>Here is my python code</p>
  
  <pre><code>import pdfkit
  
  
  with open("performance_report.html", "rb") as f:
      str = f.read()
      pdfkit.from_string(str, 'out.pdf')
  </code></pre>
  
  <p>I have tried Landscape mode as well by using below code in html. But same result.</p>
  
  <pre><code>&lt;head&gt;
    &lt;meta name="pdfkit-page-size" content="Legal"/&gt;
    &lt;meta name="pdfkit-orientation" content="Landscape"/&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Html Code</p>
  
  <pre><code>        &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta name="pdfkit-page-size" content="Legal"/&gt;
    &lt;meta name="pdfkit-orientation" content="Landscape"/&gt;
  &lt;/head&gt;
  
  &lt;h1&gt; Performance report for date: 2018-05-27 &lt;/h1&gt; &lt;br&gt;&lt;br&gt; &lt;div style="display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;"&gt;
    &lt;div  style=" position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
    flex: 0 0 75%;
      max-width: 60%;
  
     "&gt;
      &lt;div  style="background-color: #fff;    position: relative;
      margin-bottom: 1.5rem;
      border: 0;
      border-radius: 0.2rem;
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
      margin-left: auto !important;
      margin-right: auto !important;
      padding-top: 0 !important;"&gt;
        &lt;div  style="    padding: 0.75rem 1.25rem;
        border-bottom: 1px solid transparent;
        font-weight: 500;background: #F0F8FF;"&gt;Requests (%)&lt;/div&gt;
        &lt;div  style="padding: 1.25rem;padding-left: 0.5rem !important;padding-right: 0 !important;"&gt;
          &lt;img src="cid:request_offload"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
    &lt;/div&gt;
    &lt;div  style="position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;flex: 0 0 25%;
    max-width: 20%;"&gt;
      &lt;div style="background-color: #fff;    position: relative;
    margin-bottom: 1.5rem;
    border: 0;
    border-radius: 0.2rem;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.15);
    margin-left: auto !important;
    margin-right: auto !important;
    padding-top: 0 !important;"&gt;
        &lt;div  style="    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid transparent;
    font-weight: 500;background: #F0F8FF;"&gt;Summary&lt;/div&gt;
        &lt;div  style="padding: 1.25rem;padding-left: 1rem !important;
        padding-right: 1rem !important;height: 245px;    box-sizing: border-box;"&gt;
          &lt;div  style="display: flex;
        flex-wrap: wrap;
        margin-right: -15px;
        margin-left: -15px;"&gt;
            &lt;div  style="    position: relative;
            width: 100%;
            min-height: 1px;
            padding-right: 15px;
            padding-left: 15px;"&gt;
              &lt;div style="display: flex;
              flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;"&gt;
                &lt;div  style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px;    font-size: 14px;
                font-weight: bold; flex: 0 0 50%;
                max-width: 50%;"&gt;Total:&lt;/div&gt;
                &lt;div  style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px; flex: 0 0 50%;
                max-width: 50%;"&gt;1.03B &lt;/div&gt;
              &lt;/div&gt;
              &lt;div  style="     display: flex;   flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;    margin-bottom: 1rem !important;margin-top: 1rem !important;"&gt;&lt;/div&gt;
              &lt;div  style="display: flex;
              flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;"&gt;
                &lt;div  style="position: relative;
              width: 100%;
              min-height: 1px;
              padding-right: 15px;
              padding-left: 15px;    font-size: 14px;
              font-weight: bold; flex: 0 0 50%;
              max-width: 50%;"&gt;Peak:&lt;/div&gt;
                &lt;div style="position: relative;
              width: 100%;
              min-height: 1px;
              padding-right: 15px;
              padding-left: 15px;flex: 0 0 50%;
              max-width: 50%;"&gt;2.48 %&lt;/div&gt;
              &lt;/div&gt;
              &lt;div  style="display: flex;    margin-top: 0 !important;
              flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;"&gt;
                &lt;div  style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px;flex: 0 0 100%;
                max-width: 100%;"&gt;
                  &lt;small  style="color: #808080;font-weight: normal !important;
                  font-size: 85% !important;"&gt;at Sun, 27 May 2018 00:50:00 -0000&lt;/small&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div  style="     display: flex;   flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;    margin-bottom: 1rem !important;margin-top: 1rem !important;"&gt;&lt;/div&gt;
              &lt;div  style="display: flex;
              flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;"&gt;
                &lt;div  style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px;    font-size: 14px;
                font-weight: bold; flex: 0 0 50%;
                max-width: 50%;"&gt;Least:&lt;/div&gt;
                &lt;div  style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px; flex: 0 0 50%;
                max-width: 50%;"&gt;0.45 %&lt;/div&gt;
              &lt;/div&gt;
              &lt;div  style="display: flex;    margin-top: 0 !important;
              flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;"&gt;
                &lt;div style="position: relative;
                width: 100%;
                min-height: 1px;
                padding-right: 15px;
                padding-left: 15px;flex: 0 0 100%;
                max-width: 100%;"&gt;
                  &lt;small  style="color: #808080;font-weight: normal !important;
                font-size: 85% !important;"&gt;at Sun, 27 May 2018 13:15:00 -0000&lt;/small&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div  style="     display: flex;   flex-wrap: wrap;
              margin-right: -15px;
              margin-left: -15px;    margin-bottom: 1rem !important;margin-top: 1rem !important;"&gt;&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/html&gt;
  </code></pre>