Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Probeme in the second page of PDF generated #477

Open
Bruno92400 opened this issue May 27, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@Bruno92400
Copy link

commented May 27, 2019

Hi,

I'm using html2pdf 5.2.1 with PHP 5.5.9

For the two exemple, there is the same image in the first page.

This a PDF generation with no problem with the second page :
PDF1

In some case, there is a generation problem with the second page :
PDF2

This is my code :

<page backtop="5mm" backbottom="15mm" backleft="5mm" backright="5mm">
    <page_footer>
        <table style="width: 100%;">
            <tr>
                <td style="text-align: left; width: 50%"><b>Compte-rendu généré le {{ downloadDate | date("d/m/Y à H:i") }}</b></td>
                <td style="text-align: right; width: 50%"><img style="position: fixed; bottom: 10px; right: 20px;" src="{{ lestaffLogoPAth }}" height="40"/></td>
            </tr>
        </table>
    </page_footer>
    <div style="width: 700px;">
        {% if image %}
        <img style="max-width:180px; max-height:950px; float: left;" src="{{ image }}">
        <div style="width: 500px;">
        {% else %}
        <div style="width: 700px;">
        {% endif %}
            <h2 style="text-align: center; color: #009e7e;">Compte-rendu de staff</h2>
            <h2 style="text-align: center;">{{ name }}</h2>
            <br/>

            <h3 style="color: #009e7e;">Informations générales</h3>
            <p>Session du {{ sessionStart | date("d/m/Y") }} au {{ sessionEnd | date("d/m/Y") }}</p>
            <p>Coordinateur du staff : {% if owner.roles[0] != 'ROLE_INSTITUTIONAL' and owner.roles[0] != 'ROLE_RESTRICTED_INSTITUTIONAL' %}Dr {% endif %}{{ owner.lastname }} {{ owner.firstname }}</p>
            {% if managers|length > 0 %}
                <p>Administrateur(s) du staff : {% for key, manager in managers %}{% if manager.roles[0] != 'ROLE_INSTITUTIONAL' and manager.roles[0] != 'ROLE_RESTRICTED_INSTITUTIONAL' %}Dr {% endif %}{{ manager.lastname }} {{ manager.firstname }}{% if managers|length > (key + 1) %}, {% endif %}{% endfor %}</p>
            {% endif %}
            {% if participants|length > 0 %}
                <p>Médecin{% if participants|length > 1 %}s{% endif %} ayant participé à la session :</p>
                <ul>
                    {% for member in participants %}
                      <li>{% if member.roles[0] != 'ROLE_INSTITUTIONAL' and member.roles[0] != 'ROLE_RESTRICTED_INSTITUTIONAL' %}Dr {% endif %}{{ member.lastname }} {{ member.firstname }} {% if member.speciality %}({{ member.speciality }}){% endif %}</li>
                    {% endfor %}
                </ul>
            {% endif %}

            {% if staffReviews|length > 0 %}
                <br/>
                <h3 style="color: #009e7e;">Avis du staff</h3>
                {% for staffReview in staffReviews %}
                    <p><b>{{ staffReview.patient.fullName }}</b> ({{ staffReview.patient.birthdate }}) créé le {{ staffReview.patient.createdAt | date("d/m/Y à H:i") }}</p>
                    <p>{% if staffReview.patient.freeDiagnostic %}Diagnostic : {{ staffReview.patient.freeDiagnostic }} ; {% endif %}Médecin responsable : {% if not staffReview.patient.isDoctorInstitutional %}Dr {% endif %}{{ staffReview.patient.doctorFullName }}</p>
                    {% if staffReview.patient.logEntries|length > 0 %}
                        <p>Anamnèse :</p>
                        {% for logEntry in staffReview.patient.logEntries %}
                            <p style="width: 500px; white-space: pre-wrap; word-break: break-all;"><b>{{ logEntry.date }}</b> : {{ logEntry.description | raw }}</p>
                        {% endfor %}
                    {% endif %}
                    {% if staffReview.patient.customFields|length > 0 %}
                        <p>Informations complémentaires :</p>
                        {% for customFieldsFirst in staffReview.patient.customFields %}
                            {% if customFieldsFirst.children is defined %}
                                <div>{{ customFieldsFirst.label }}</div>
                                {% for customFieldsSecond in customFieldsFirst.children %}
                                    {% if customFieldsSecond.children is defined %}
                                        <div style="margin-left: 15px;">{{ customFieldsSecond.label }}</div>
                                        {% for customFieldsThird in customFieldsSecond.children %}
                                            {% if customFieldsThird.children is defined %}
                                                <div style="margin-left: 30px">{{ customFieldsThird.label }}</div>
                                                {% for customFieldsForth in customFieldsThird.children %}
                                                    {% if customFieldsForth.children is defined %}
                                                        <div style="margin-left: 45px">{{ customFieldsForth.label }}</div>
                                                        {% for customFieldsFifth in customFieldsForth.children %}
                                                            {% if customFieldsFifth.children is defined %}
                                                                <div style="margin-left: 60px">{{ customFieldsFifth.label }}</div>
                                                                {% for customFieldsSixth in customFieldsFifth.children %}
                                                                    {% if customFieldsSixth.children is defined %}
                                                                        <div style="margin-left: 75px">{{ customFieldsSixth.label }}</div>
                                                                        {% for customFieldsSeventh in customFieldsSixth.children %}
                                                                            {% if customFieldsSeventh.children is defined %}
                                                                                <div style="margin-left: 90px">{{ customFieldsSeventh.label }}</div>
                                                                                {% for customFieldsEighth in customFieldsSeventh.children %}
                                                                                    <div style="margin-left: 105px">{{ customFieldsEighth.label }} : {{ customFieldsEighth.content }}</div>
                                                                                {% endfor %}
                                                                            {% else %}
                                                                                <div style="margin-left: 90px;">{{ customFieldsSeventh.label }} : {{ customFieldsSeventh.content }}</div>
                                                                            {% endif %}
                                                                        {% endfor %}
                                                                    {% else %}
                                                                        <div style="margin-left: 75px;">{{ customFieldsSixth.label }} : {{ customFieldsSixth.content }}</div>
                                                                    {% endif %}
                                                                {% endfor %}
                                                            {% else %}
                                                                <div style="margin-left: 60px;">{{ customFieldsFifth.label }} : {{ customFieldsFifth.content }}</div>
                                                            {% endif %}
                                                        {% endfor %}
                                                    {% else %}
                                                        <div style="margin-left: 45px;">{{ customFieldsForth.label }} : {{ customFieldsForth.content }}</div>
                                                    {% endif %}
                                                {% endfor %}
                                            {% else %}
                                                <div style="margin-left: 30px;">{{ customFieldsThird.label }} : {{ customFieldsThird.content }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% else %}
                                        <div style="margin-left: 15px;">{{ customFieldsSecond.label }} : {{ customFieldsSecond.content }}</div>
                                    {% endif %}
                                {% endfor %}
                            {% else %}
                                <div>{{ customFieldsFirst.label }} : {{ customFieldsFirst.content }}</div>
                            {% endif %}
                        {% endfor %}
                    {% endif %}
                    {% for content in staffReview.contents %}
                        <p style="text-decoration: underline;">Avis posté le {{ content.createdAt | date("d/m/Y à H:i") }} :</p>
                        <p>{{ content.text | raw }}</p>
                    {% endfor %}
                    <br/>
                {% endfor %}
            {% endif %}
        </div>
    </div>
</page>

Have you an idea?

Sincerely,
Bruno

@Bruno92400 Bruno92400 changed the title Probeme in the second page Probeme in the second page of PDF generated May 27, 2019

@LittleBigFox

This comment has been minimized.

Copy link
Contributor

commented May 28, 2019

Hi Bruno!
Could you explain where is your problem? I've opened the two images in tabs, i didn't see the difference...

Regards,
LBF

@Bruno92400

This comment has been minimized.

Copy link
Author

commented May 28, 2019

In the first image, between the first and the second page you can see all text is vertical align.

In the second image for the second page, the text begin at the right of page. and not vertical align like the first one.

Is that most clearly?

Regards,
Bruno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.