кукловод Проблема с разрывом изображения - PullRequest
0 голосов
/ 19 июня 2020

Я генерирую pdf из html. Но не могу сгенерировать должным образом. Изображение подписи разбито на другой странице. проверьте изображение ниже. Есть ли способ, чтобы, если содержимое или изображение сломалось, оно переместится на другую страницу pdf.

версия кукловода - версия узла 3.3.0 - 12.16.1

проверьте изображение здесь

Код:

await page.pdf({
                    path: pdfPath,
                    format: 'A4',
                    printBackground: true,
                    displayHeaderFooter: true,
                    headerTemplate: '<div id="header-template" style="font-size:10px !important; color:#808080; padding-left:10px"><span class="">Production</span></div>',
                    footerTemplate: '<div id="footer-template" style="font-size:10px !important; color:#808080; padding-left:10px"><span class="">Production</span><span class="pageNumber" style="font-size:10px !important; color:#808080; padding-left:200px"></span></div>',
                    margin: {
                        top: '100px',
                        bottom: '100px',
                        right: '30px',
                        left: '30px',
                    },
                });
html:
<div style="float: left; margin-top: 5px;width: 98.5%;">
                <div id="signature">
                    <div class="sign">
                        <img src="{{signature}}" alt="sign"
                            style="margin-top: 10px;width: 120px;height: 120px;float: right;" />
                    </div>
                    <span>Signature By {{ signature_by }}<br>({{ signature_by_role }})</span>
                </div>
            </div>

CSS:

#signature {
            float: right;
            width: auto;
            margin-right: 1%;
        }
        #signature img {
            width: 100%;
        }
        #signature span {
            text-align: center;
            width: 100%;
            color: #000;
            float: left;
            font-size: 11px;
            font-weight: 500;
        }
        .sign {
            min-height: 50px;
            text-align: center;
            margin: 0 auto;
        }
...