Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Mar 18, 2024 4:30 pm

Hi,

We are currently experimenting with using Spire.Doc on Python and are probably going to request a trial.
We did face an issue trying to convert HTML to Word (2019 Docx)

For many documents we have, it does work. However, for some it seems to fail and we are unsure why.

Below I added the code we are using:

Code: Select all
# Create an object of the Document class
        document = Document()
        # Add a section to the document
        sec = document.AddSection()

        # Add a paragraph to the section
        paragraph = sec.AddParagraph()

        # Specify the HTML string
        htmlString = f"""
        <html>
        <body>
        {protocol["HTML"]}
        </body>
        </html>
        """

        # Append the HTML string to the paragraph
        paragraph.AppendHTML(htmlString)

        # Save the result document
        document.SaveToFile(outputFile, FileFormat.Docx2019)
        document.Close()


With protocol["HTML"] usually working, with the exception of a few that give us the following Exception:

Code: Select all
Unhandled Exception: System.InvalidOperationException: InvalidOperation_EmptyStack
   at System.Collections.Generic.Stack`1.ThrowForEmptyStack() + 0x33
   at System.Collections.Generic.Stack`1.Pop() + 0x42
   at sprkyl.spra(XmlNode, XmlNode) + 0xb4
   at sprkyl.spran(XmlNode) + 0x1df
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.spran(XmlNode) + 0x1bff
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.sprac(XmlNode) + 0xe53
   at sprkyl.spran(XmlNode) + 0x1ed0
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.sprap(XmlNode) + 0x2e
   at sprkyl.spran(XmlNode) + 0x1a61
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.sprap(XmlNode) + 0x2e
   at sprkyl.spran(XmlNode) + 0x1a61
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.sprap(XmlNode) + 0x2e
   at sprkyl.spran(XmlNode) + 0x1a61
   at sprkyl.spra(XmlNodeList) + 0xc3
   at sprkyl.sprdh1(IBody, String, Int32, Int32) + 0x15cd
   at Spire.Doc.Documents.Paragraph.AppendHTML(String) + 0x255
   at Spire.Doc.AOT.NLParagraph.Paragraph_AppendHTML(IntPtr, IntPtr) + 0x58


The protocol["HTML"] that we are adding in this case, is the following:

Code: Select all
<p style="font-size: medium; font-weight: normal;">Versienummer : 1<br>Versiedatum : Oktober 2017</p>
<h1 style="text-align: center;">Intra-orale opname</h1><hr>

<ul>
<li><p>Opnamen worden alleen vervaardigd op indicatie van de tandarts.</p></li>
<li><p>De volgende personen zijn gerechtigd tot het maken van opnamen:
<br><em><u>Klik hier als u tekst wilt invoeren.</u></em></p></li>
<li><p>Vraag naar zwangerschap, indien zwanger overleg met de tandarts in verband met urgentie van diagnose en behandeling.</p></li>
<li><p>Informeer de pati&euml;nt over de reden voor het maken van een foto.</p></li>
<li><p>In geval van twijfel over de te volgen opnameprocedure of andere onvoorziene situaties wordt contact opgenomen met de tandarts.</p></li>
<li>
<p>Bij twijfel aan de goede werking van het röntgentoestel wordt de opname uitgesteld en contact opgenomen met de toezichthoudend stralingsdeskundige.</p></li></ul>
<p>
<ul>
<li><p>Geef de pati&euml;nt instructie over goede steun van het hoofd om beweging te voorkomen.</p></li>
<li><p>Schildklierkraag hoog tegen kin positioneren om schildklier te beschermen.</p></li>
<li><p>Laat de richtapparatuur zien en vertel om hoeveel opnamen het gaat.</p></li>
<li><p>Trek handschoenen aan.</p></li>
<li><p>Houdt met de ene hand de mondhoek opzij om goed zicht te hebben en plaats met de andere hand de richtapparatuur.</p></li>
<li><p>Vraag de pati&euml;nt om dicht te bijten en gebruik zonodig een wattenrol om de apparatuur te stabiliseren.</p></li>
<li>
<p>Controleer belichtingstijd. </p></li>
<li>
<p>Richt de röntgenbuis in het juiste horizontale vlak en in een correcte verticale hoek.</p></li>
<li>
<p>Loop naar de timer, en ga achter de muur staan.</p></li>
<li>
<p>Houdt de knop zo lang ingedrukt tot de piep over is gegaan.</p></li>
<li>
<p>Haal de foto en richtapparatuur uit de mond en leg deze op de tray.</p></li>
<li>
<p>Breng de röntgenbuis weer terug op zijn plaats.</p></li></ul>
<p>
<ul>
<li>
<p>De gemaakte opnamen worden beoordeeld door de tandarts, in eerste instantie op kwaliteit, vervolgens ook op diagnostische inhoud. Opnamen worden direct na het vervaardigen toegevoegd aan het pati&euml;ntendossier.</p></li>
<li>
<p>De diagnostische kwaliteit van de opnamen kan worden ingedeeld in drie categorie&euml;n. Minimaal 70% van de opnamen moet zonder meer voldoen aan de gebruikelijke kwaliteitseisen. Er moet worden gestreefd naar zo min mogelijk opnamen die om kwaliteitsredenen moeten worden overgemaakt; het aantal opnamen in deze categorie mag in elk geval niet meer zijn dan 10%.</p></li></ul>


We are uncertain if this is a faulty HTML, or that there is some other issue. Cause in most cases, it works. We also tried removing the ö character, but without success.

Thanks for helping us out!

matzzz99
 
Posts: 5
Joined: Mon Mar 18, 2024 4:23 pm

Tue Mar 19, 2024 6:38 am

Hello,

Thanks for your inquiry.
After testing, I have indeed reproduced the issue you mentioned. And I have logged this issue into our tracking system with ticket SPIREDOC-10390. Our development team will further investigate and fix it. If there is any progress, I will inform you as soon as possible. Sorry for any inconvenience caused to you.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 419
Joined: Mon Dec 27, 2021 2:23 am

Fri Apr 12, 2024 9:36 am

Dear William,

Is there any update on the progress of resolving this issue?
I am looking forward to hearing from you.

matzzz99
 
Posts: 5
Joined: Mon Mar 18, 2024 4:23 pm

Mon Apr 15, 2024 8:32 am

Hello,

Thanks for your following up.
Sorry, regarding issue SPIREDOC-10390, we have not made any breakthrough progress yet. I will urge our deve team to accelerate the processing speed, and I will inform you promptly if there is any progress.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 419
Joined: Mon Dec 27, 2021 2:23 am

Wed May 01, 2024 7:24 am

Hi William,

Has there been any progress? Is there a place where I can follow the progress on the fix?

Thanks for you help.

matzzz99
 
Posts: 5
Joined: Mon Mar 18, 2024 4:23 pm

Wed May 01, 2024 8:18 am

Hello,

Thanks for your message.
I apologize that our issue tracking system is currently not accessible for you to directly view the progress. I have just checked the issue of SPIREDOC-10390, at present there has been no significant progress yet. We are currently on the International Labor Day holiday, our Dev team come back to work on May 6th. I will urge them to work on it. Once a corresponding hotfix version is available, we will inform you as soon as possible. Thank you for your understanding.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1267
Joined: Wed Apr 25, 2018 3:20 am

Fri May 17, 2024 12:00 pm

Hi Lisa,

Thanks for your reply.
We are understanding of the fact that some bugs take longer to fix due to their complexity.
However, resolving the issue is vital to our data migration that we are planning on performing soon.

Has there been any significant progress on the issue? If so, when could we expect an update that resolves this issue.
Or, alternatively, are there work-arounds to avoid the issue that are known to work? For example, using the .NET version of Spire Doc?

Thanks in advance for your reply.

matzzz99
 
Posts: 5
Joined: Mon Mar 18, 2024 4:23 pm

Mon May 20, 2024 9:15 am

Hello,

Thank you for your message.
I regret that the issue has not been resolved yet, the error also exists when using the .NET version. We have given a high priority to the case, our development team is working diligently to address it. Once there is any new progress, we will keep you updated promptly. Thank you for your understanding.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1267
Joined: Wed Apr 25, 2018 3:20 am

Tue Jun 18, 2024 9:22 am

Hi Lisa,

I was wondering if there has been any progress on this issue.
It has been 3 months since we first reported the problem.

matzzz99
 
Posts: 5
Joined: Mon Mar 18, 2024 4:23 pm

Tue Jun 18, 2024 9:50 am

Hello,

Thanks for your following up.
Regarding your issue, we have adjusted the internal code and it is in the testing phase now. Once the tests pass, we will prepare a hotfix version for you asap. Thanks for your patience.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 419
Joined: Mon Dec 27, 2021 2:23 am

Fri Jun 28, 2024 8:29 am

Hello,

Thank you for your patience.
Glad to inform that we just released Spire.Doc for Python Version:12.6.0 which fixed the issue of SPIREDOC-10390, welcome to test it.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 419
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc

cron