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.

Fri May 17, 2024 8:33 pm

I'm getting this error while trying to call Spire's LoadHTML(textReader, XHTMLValidationType.None);

StackTrace:

[code] at System.ThrowHelper.ThrowKeyNotFoundException[T](T key) in System\ThrowHelper.cs:line 217
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) in System.Collections.Generic\Dictionary.cs:line 694
at Spire.Doc.Table.蹖(Dictionary`2 A_0, Int32 A_1) in Spire.Doc\Table.cs:line 2597
at Spire.Doc.Table.辌() in Spire.Doc\Table.cs:line 2509
at Spire.Doc.Table.隱() in Spire.Doc\Table.cs:line 2623
at spr匘.輯() in -\spr匘.cs:line 5768
at spr匘.蹖(XmlNode A_0, 蹵 A_1, Table A_2) in -\spr匘.cs:line 9942
at spr匘.迩(XmlNode A_0) in -\spr匘.cs:line 9861
at spr匘.錏(XmlNode A_0) in -\spr匘.cs:line 4897
at spr匘.蹖(XmlNodeList A_0) in -\spr匘.cs:line 4240
at spr匘.⿏(IBody A_0, String A_1, Int32 A_2, Int32 A_3) in -\spr匘.cs:line 3467
at Spire.Doc.Body.蹖(String A_0, Int32 A_1, Int32 A_2, Int32 A_3) in Spire.Doc\Body.cs:line 186
at Spire.Doc.Document.蹖(TextReader A_0, XHTMLValidationType A_1, Int32 A_2) in Spire.Doc\Document.cs:line 4785
at Spire.Doc.Document.LoadHTML(TextReader reader, XHTMLValidationType validationType) in Spire.Doc\Document.cs:line 4770[/code]

Version: Spire.Doc 12.4.7 for .Net (using NuGet package)
Environment: Windows 10, .Net8.0, class library, English Canada
Code:
[code]
TextReader textReader = new StringReader(htmlString);

LoadSpireLicense();

var spireDocument = new Document();
spireDocument.LoadHTML(textReader, XHTMLValidationType.None);
[/code]

The exception happens on the last line. I have attached a file that gives the exception and one that doesn't. The only difference is that one has a line of CSS "width: 100%" and that fails and the other I replaced it with "width: 1920px" and that succeeds. This is only as a workaround for now.


Since I have tried several times to attach a file and paste the content in, but just get this:

[quote]Request blocked. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.[/quote]

Please let me know how I can provide a sample to you. It is HTML.

applemoth
 
Posts: 2
Joined: Fri May 17, 2024 4:09 pm

Mon May 20, 2024 2:50 am

Hi,

Thank you for your message and sorry to reply late for weekend.
Did you add the attachment via 'Upload attachment' below? If not, please try again. If it still doesn't work, please let us know and we'll look into the issue as soon as possible and please email the files to 'Support@e-iceblue.com'. Thank you so much for your assistance!

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 194
Joined: Mon Nov 07, 2022 8:10 am

Tue May 21, 2024 3:23 pm

Yes, I tried the "upload attachment" several times :). This is the error I receive:

403 ERROR
The request could not be satisfied.
Request blocked. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)


I suspect it's because the file contains XML? I will email the files

applemoth
 
Posts: 2
Joined: Fri May 17, 2024 4:09 pm

Wed May 22, 2024 6:51 am

Hi,

Thank you for your feedback.
I have reproduced this issue and logged it into our bug tracking system with ticket number SPIREDOC-10551. Our dev team will investigate it and fix it. Once it's resolved, we will update you in time. Sorry for the inconvenience caused.

Besides, thank you for your feedback about the problem of being unable to upload files. Our website administrator said that it was caused by the firewall, and we are reporting it to the superior for a solution.

Sincerely,
Doris
E-iceblue support team
User avatar

Doris.Liu
 
Posts: 194
Joined: Mon Nov 07, 2022 8:10 am

Return to Spire.Doc