Page 1 of 1

How to set value of binding control in main document ?

PostPosted: Thu Apr 21, 2011 9:02 pm
by verrnum
Hi,

I use custom XML to store valeus of variables.

The data biding works successfulyl when opening document with MS Word.
But i use Aspose.Words to convert my document in PDF and Aspose.Words seems to ignore the variables values in my custom XML .

Aspose.Words only convert the value in "<w:t> tag.

So how can i bin,d the value from my custom XML file and write the value in main document ?

I found this source code :

Code: Select all
for(CustomXmlDataStoragePart customXmlDataStoragePart 
             : wordMLPackage.getCustomXmlDataStorageParts().values()){
          customXmlDataStoragePart.applyBindings(wordMLPackage.getMainDocumentPart());
       }
       System.out.println(
                                              XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true, true)
                                             );


But it seems don't have any impact on main document part values.

Thanks for your help

Re: How to set value of binding control in main document ?

PostPosted: Fri Apr 22, 2011 5:06 am
by verrnum
Hi,

I resolved the problem by uppgrading to 2.6.0 and uses the "BindingHandler.applyBindings(wordMLPackage.getMainDocumentPart());".

It works fine !!

But now i have an another problem here :

viewtopic.php?f=6&t=698

Best Regards