Text Box with tiled image causing NullReferenceException

Technical support for Spire.Doc

Moderator: iceblue support

Text Box with tiled image causing NullReferenceException

Postby russgalloway » Tue Jul 18, 2017 12:06 am

I've run into an issue trying to load a particular Word document that happens to contain a text box with a tiled background image.

If the text box contains a background image (stretched to fill, or tiled) a NullReferenceException is thrown when, for example,
Code: Select all
var docx = new Document(docxFilePath, FileFormat.Docx2013)
is called.

A solid color works. A gradient fill doesn't throw an error but the background is transparent when saved to either a DOCX or PDF file.

Please let me know if there's any other information I can provide to help repro the issue.

Code: Select all
Object reference not set to an instance of an object.
   at spr2727.2(String A_0)
   at spr2377.1(spr1664 A_0, spr1209 A_1)
   at spr2377.1(spr1209 A_0, spr1664 A_1)
   at spr2377.1(spr1209 A_0)
   at spr2377.2(spr1209 A_0)
   at spr1503.5(MemoryStream A_0)
   at spr1503.0(MemoryStream A_0, MemoryStream A_1)
   at spr1503.0(XmlReader A_0, ParagraphItemCollection A_1, MemoryStream A_2)
   at spr1503.8(XmlReader A_0, ParagraphItemCollection A_1)
   at spr1503.16(XmlReader A_0, ParagraphItemCollection A_1)
   at spr1503.14(XmlReader A_0, IDocumentObject A_1)
   at spr1503.13(Stream A_0)
   at spr1503.1(spr395 A_0)
   at spr1503.1(Document A_0)
   at spr1503.1(Stream A_0, Document A_1)
   at spr1503.0(String A_0, Document A_1)
   at Spire.Doc.Document.16(String A_0)
   at Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
   at Spire.Doc.Document..ctor(String fileName, FileFormat type)
   at SampleProject.SampleForm.LoadTemplate(String templateFilename) in C:\src\sample-project\SampleForm.cs:line 42
russgalloway
 
Posts: 3
Joined: Mon Jul 17, 2017 11:44 pm

Re: Text Box with tiled image causing NullReferenceException

Postby Jane.Bai » Tue Jul 18, 2017 1:49 am

Hello,

Thanks for your inquiry.
To help us with a better investigation, could you please share your sample document?

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 626
Joined: Tue Nov 29, 2016 1:47 am

Re: Text Box with tiled image causing NullReferenceException

Postby russgalloway » Tue Jul 18, 2017 4:53 am

Attached.

(apologies, if applicable) I forgot to mention that this docx file was created using Word for Mac v15.36 (10702).

Super quick response much appreciated.
You do not have the required permissions to view the files attached to this post.
russgalloway
 
Posts: 3
Joined: Mon Jul 17, 2017 11:44 pm

Re: Text Box with tiled image causing NullReferenceException

Postby Jane.Bai » Tue Jul 18, 2017 6:01 am

Hello,

Thanks for sharing your document.
After an initial test with the Spire.Doc Pack(hot fix) Version:6.0.1, the issue didn't occur on my side. I guess you were using our Free version, right? Please first try the latest version and have a test. If the issue still troubles you, please come back to us and provide more details on your running environment.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 626
Joined: Tue Nov 29, 2016 1:47 am

Re: Text Box with tiled image causing NullReferenceException

Postby russgalloway » Tue Jul 18, 2017 12:20 pm

Correct -- using the FreeSpire.Doc v5.7 nuget package I get a NullReferenceException. When I tried the Spire.Doc 6.0.1 nuget package I no longer get a NullReferenceException. However, after saving the loaded document as a PDF the text box's background image isn't tiled like the original Word document; it's stretched to fill the text box.
russgalloway
 
Posts: 3
Joined: Mon Jul 17, 2017 11:44 pm

Re: Text Box with tiled image causing NullReferenceException

Postby Betsy.jiang » Wed Jul 19, 2017 1:58 am

Dear russgalloway,

Thanks for your feedback.
I have noticed the issue and forwarded it to our Dev team. We will let you know once there is any progress.
Sorry for the inconvenience.

Sincerely,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 1640
Joined: Tue Sep 06, 2016 8:30 am

Re: Text Box with tiled image causing NullReferenceException

Postby Betsy.jiang » Thu Aug 10, 2017 5:53 am

Dear russgalloway,

Thanks for waiting.
Now the issue has been resolved in following hotfix. Welcome to have a test.
http://www.e-iceblue.com/downloads/hot_ ... _6.0.7.zip
Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 1640
Joined: Tue Sep 06, 2016 8:30 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 1 guest

cron