Aspose word not generating large text field

Hi there,

I use Aspose.Word to generate documents off templates, when I have a large text field in the template, Aspose generates the document correctly in DOC format but nothing comes out in PDF format. I’ve attached my test app and the template in a zip file.
The code is pretty straight forward, below is the code snippet.
I have a large string about 5000 characters in length, and template just have one merge field. when I use SaveFormat.Doc, it works fine; when I change it to SaveFormat.Pdf, the generated document shows an empty table cell. I’ve also attached screenshot for Aspose.Word version info and the output I’ve observed.

string aa = @“1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789a”;
Document doc = new Document(@“c:\downloads\testtemplate.doc”);

// Fill the fields in the document with user data.
doc.MailMerge.Execute(
new string[] { “TestField” },
new object[] { aa });

doc.Save(@“c:\downloads\test.out.pdf”, SaveFormat.Pdf);

thanks

Hi Hui,


Thanks for your inquiry.

I have tested the scenario and have not found the shared issue while using latest version of Aspose.Words for .NET 14.1.0. Please use the latest version of Aspose.Words for .NET 14.1.0. I have attached the output Pdf file with this post for your kind reference.

Thanks for the reply, I am not sure if I could update to latest version at the moment, could you confirm this is a bug in v11.2 and in which version did this get fixed?

thx

Hi Hui,


Thanks for your inquiry. Yes, this was a bug in Aspose.Words 11.2.0 and has now been fixed in Aspose.Words 14.1.0. I suggest you please always use latest versions of Aspose.Words:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

If we can help you with anything else, please feel free to ask.

Best regards,

Hi there,

I’ve upgraded to v14.1, now one of my report is crashing. I wrote a demo code to reproduce it.
this test app doesn’t output anything, it just does the merge. With the version I previously used(v11.2) this code will work just fine, but with 14.1, it crashes at MailMerge.Execute

stack trace is like the following. it doesn’t show any useful information, please take a look

thx

Failures:
1) xxxx : System.NullReferenceException :
Object reference not set to an instance of an object.

Server stack trace:
at xe86f37adaccef1c3.xc5c3f438428cb03b.x446c2c253cdada74(x561fa53c007d3597 xe01ae93d9fe5a880)
at xe86f37adaccef1c3.xc5c3f438428cb03b.xb7e46440d2a34d6d(x561fa53c007d3597 xe01ae93d9fe5a880, FieldMergingArgs& xfbf34718e704c6bc)
at xfbd1009a0cbb9842.x561fa53c007d3597.x67bf65e8693cdf2e(xc5c3f438428cb03b xa4d52e34b62b5495, MailMerge x2a99de81295e7f29)
at xfbd1009a0cbb9842.xfedf115fd9c03862.xc0425e9d15f16649(Field xe01ae93d9fe5a880)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x652f6183bc2805f1(Field xe01ae93d9fe5a880)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x0f4b7f3b2ee62d4b(x5e36356bc92c609b x0f7b23d1c393aed9)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x4e3cfc222c92cda7(x5e36356bc92c609b x0f7b23d1c393aed9)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x92fd9b2325a0103b(x5e36356bc92c609b x0f7b23d1c393aed9)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x945dc04ac4e4f5ab(xb0b76bad05a97c8b xd3311d815ca25f02)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x7b62f4210c900502(xcf417e2db4fe9ed3 xb1a1ccf3b9674a87, xcf417e2db4fe9ed3 x8f8ce337d74845ae)
at xe86f37adaccef1c3.xc5c3f438428cb03b.xdeeb682062ef79a5()
at xe86f37adaccef1c3.xc5c3f438428cb03b.xd5da23b762ce52a2(xa11a4c48b53f49a6 xef1769c4fe6ae4ca, Boolean xc9c7b90943167aed)
at Aspose.Words.Reporting.MailMerge.x18dfca7c5fd2402f(xa11a4c48b53f49a6 xef1769c4fe6ae4ca)

Hi Hui,


Thanks for your inquiry. The issue you are facing is due to mail merge field name with no name. Please check the attached image for detail. Please remove or set the name of such mail merge fields in your input document. This will solve your issue. I have modified your template document and have attached it with this post for your kind reference.

Please let us know if you have any more queries.