barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.59k stars 289 forks source link

Rotated text in <thead> cells not visible after first page. #492

Open souravdutt opened 1 year ago

souravdutt commented 1 year ago

Hey! thanks for this extremely useful package. ❤

I'm having issue when trying to create pdf with rotated texts in table headers. The text is visible on first page but from second page it disappear from all pages. have a look at below screenshot to understand better: First Page: image

Second Page image

for further information I'm using below CSS to rotate the texts in cell:

      thead { display: table-header-group; }
      tr { page-break-inside: avoid; }
      th.rotate,
      td.rotate{
          padding: 5px;
          text-align: center;
          white-space: nowrap;
          vertical-align: middle;
          width: 1.5em;
      }
      th.rotate div,
      td.rotate div {
          -moz-transform: rotate(-90.0deg);  /* FF3.5+ */
          -o-transform: rotate(-90.0deg);  /* Opera 10.5 */
          -webkit-transform: rotate(-90.0deg);  /* Saf3.1+, Chrome */
          filter:  progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083);  /* IE6,IE7 */
          -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */
          margin-left: -10em;
          margin-right: -10em;
      }

    <table>
            <thead>
                      <th class="rotate" rowspan="3">
                            <div>
                                Certified Surgeons <br>
                                Certificate No.
                            </div>
                       </th>
            </thead>
    </table>

Please let me know if need any other information. Thanks in advance! Happy new year... 😊

sabinnitu commented 1 year ago

Hello, did you manage to find a solution?

souravdutt commented 1 year ago

@sabinnitu hi, I somehow managed with a trick but didn't find a permanent solution.. as I only wanted to perform this on static texts for table headers. So I made images for each rotated text and used it inside table headers, which solved my problem. 😅

sabinnitu commented 1 year ago

It's an idea. 😂 Thanks for the reply!

souravdutt commented 1 year ago

Enjoy mate.. I switched off the project for a few weeks and started working on other projects.. when I came back then I realised this trick and it works.. 😁

But still looking forward for a real solution