Forum


Replies: 1   Views: 1554
Word 2010 showing high cpu / memory usage when opening document
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by vpratfr  · 08-04-2020 - 10:40

Hi,

I am currently testing your package before buying a license and one thing has me worried: when opening the resulting Docx file with MS Word 2010 (on Windows 10), the CPU usage goes really high and it gets impossible to simply select some text and edit the document.

We have a very basic usage of the package: we generate HTML and just pass that to the embedHTML function.

// Here is how we create the file
$docx = new CreateDocx();
$docx->embedHTML(file_get_contents($htmlFile));
$docx->removeHeadersAndFooters();
$docx->createDocx($wordFile);

And below is the HTML we pass to it (that HTML appears to be valid according to the W3C validator)

<!DOCTYPE html><html><head>
            <title>Document</title>
            <style>body {
    font-size   : 10pt;
    font-family : "Helvetica Neue", Helvetica, Arial, sans-serif;
    padding     : 10mm;
}

h1 {
    font-size : 18pt;
}

h2 {
    font-size : 15pt;
}

h3 {
    font-size : 13pt;
}

h4 {
    font-size : 12pt;
}

h5 {
    font-size : 11pt;
}

h6 {
    font-size : 10pt;
}

h1.document-heading {
    text-align    : center;
    font-size     : 18pt;
    margin-bottom : 20pt;
    margin-top    : 0;
}

small, .small {
    font-size : 0.8rem;
}

.page-break {
    page-break-before : always;
}

.page-break-avoid, .section {
    page-break-inside : avoid;
}

.text-center {
    text-align : center;
}

.text-muted {
    color : #666;
}

.w-0 {
    width : 0;
}

.w-33 {
    width : 34%;
}

.w-66 {
    width : 66%;
}

.w-25 {
    width : 25%;
}

.w-50 {
    width : 50%;
}

.w-75 {
    width : 75%;
}

.w-100 {
    width : 100%;
}

.mt-3 {
    margin-top : 20pt;
}

.mt-4 {
    margin-top : 25pt;
}

.mt-5 {
    margin-top : 30pt;
}

.ml-3 {
    margin-left : 20pt;
}

.ml-4 {
    margin-left : 25pt;
}

.ml-5 {
    margin-left : 30pt;
}

.table {
    padding : 0;
}

.table td {
    padding : 0;
}

.table .form-cell-title,
.table .form-cell-value {
    margin-bottom : 20pt;
}

.table .form-cell-title {
}

.table .form-cell-value {
    border-bottom : 1px dotted #aaa;
}

.signature-area {
    padding    : 6pt;
    width      : 50%;
    min-height : 40pt;
    background : #fafafa;
    border     : 1px solid #aaa;
    font-size  : 0.7rem;
    color      : #999;
}

p.company-header {
    padding : 8pt;
    border  : 1px solid #f0f0f0;
}

hr {
    border-width : 0.5pt 0 0 0;
    border-color : #f0f0f0;
    margin       : 18pt 48pt;
    height       : 0;
}

div.mail {
}

div.mail .mail-header {
    margin-bottom : 10mm;
}

div.mail .mail-to {
}

div.mail .mail-timestamp {
    margin-top : 3mm;
}

div.mail .mail-subject {
    font-weight   : bold;
    margin-bottom : 10mm;
}

div.mail .mail-salutation {
    margin-bottom : 10mm;
}

div.mail .mail-content {
}
</style>
            </head><body><div class="section section-000-person"> <!-- CHAPTER=first-chapter SECTION=000-person --> <h1 class="document-heading">DÉLÉGATION DE POUVOIR</h1> <h2>JE SOUSSIGNÉ</h2> <table class="table w-100"> <tr> <td class="form-cell-title w-33">Nom</td> <td class="form-cell-value w-66"></td> </tr> <tr> <td class="form-cell-title w-33">Prénom(s)</td> <td class="form-cell-value w-66"></td> </tr> </table> <p>Agissant au nom et pour le compte de la société TESTING INC., SAS en liquidation au capital de 500 000 euros, immatriculée au RCS de PIMPOL sous le numéro 829 982 669, dont le siège de liquidation est situé : 13 allée des fleurs 12345 BIARRITZ.</p></div><div class="section section-100-mandate"> <!-- CHAPTER=first-chapter SECTION=100-mandate --> <h2>CERTIFIE</h2> <p><strong>Avoir reçu mandat de</strong> la société RAMOS, SELAS en liquidation à capital variable au capital de 18 010 310 euros, immatriculée au RCS de ALEXANDRE sous le numéro 151 813 763, dont le siège de liquidation est situé : 38, chemin Grondin 32862 COLLETBOURG, ci après désignée le « Mandant ».</p> <table class="table w-100"> <tr> <td class="form-cell-title w-50"> <strong>Par acte en date du</strong> <span class="small text-muted">(date du pouvoir original du client)</span> </td> <td class="form-cell-value w-50"></td> </tr> </table> <p><strong>Pour</strong> assurer la publicité légale des modifications intervenues au sein du Mandant, déposer au Greffe du Tribunal de Commerce la demande d'inscription modificative au Registre du Commerce et des Sociétés, conformément au Code de Commerce et toutes les pièces annexes prévues par les textes en vigueur et produire toutes justifications, faire toutes attestations et déclarations en son nom, et généralement faire tout ce qui sera nécessaire pour l'accomplissement des formalités légales.</p></div><div class="section section-200-delegate"> <!-- CHAPTER=first-chapter SECTION=200-delegate --> <h2>CONSTITUE POUR MON DELEGATAIRE</h2> <p>La société JURIACTES, SAS au capital de 1 000 euros, immatriculée au RCS de BAYONNE sous le numéro 837 668 185, dont le siège est situé : 97, allée Théodore Monod – Estia 2 – Technopole Izarbel, 64210 BIDART </p> <p>Dûment habilitée à l'effet de la présente, à laquelle je donne tous pouvoirs à l'effet de, pour et au nom de la société qui m'a mandatée :</p> <ul> <li>assurer la publicité légale des modifications intervenues au sein du Mandant,</li> <li>déposer au Greffe du Tribunal de Commerce la demande d'inscription modificative au Registre du Commerce et des Sociétés, conformément au Code de Commerce et toutes les pièces annexes prévues par les textes en vigueur, </li> <li>produire toutes justifications, faire toutes attestations et déclarations en mon nom, et généralement faire tout ce qui sera nécessaire pour l'accomplissement des formalités légales. </li> </ul></div><div class="section section-300-signature"> <!-- CHAPTER=first-chapter SECTION=300-signature --> <table class="table w-50"> <tr> <td class="w-33">Fait à </td> <td class="form-cell-value w-66"></td> </tr> <tr> <td class="w-33">Le</td> <td class="form-cell-value w-66"></td> </tr> </table> <p class="small">(faire précéder la signature de la mention manuscrite <strong>« bon pour délégation de pouvoir »</strong>)</p></div><div class="section section-signature-area"> <!-- CHAPTER=first-chapter SECTION=signature-area --> <div class="signature-area"> Zone de signature <br> <br> <br> <br> <br> </div></div></body></html>

 

Do you have any idea of what could be going on?

It looks promising and we will probably buy a license if that can be resolved.

Thanks,