td16 wrote:How can a docx file be generated based on an specific Word template (.dot). My guess is that this information is stored in docProps/app.xml?
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" />
wordMLPackage.getContentTypeManager().addOverrideContentType(partUri, contentType)
td16 wrote:Also how can properties be set in docProps/custom.xml? Any example would help. thanks!
docPropsCustomPart.setProperty(propName, propValue)
public static void injectDocPropsCustomPart(WordprocessingMLPackage wordMLPackage) {
org.docx4j.openpackaging.parts.DocPropsCustomPart docPropsCustomPart = new org.docx4j.openpackaging.parts.DocPropsCustomPart();
java.io.InputStream is = new java.io.FileInputStream("/tmp/custompart.xml" );
docPropsCustomPart.unmarshal(is);
wordMLPackage.addTargetPart(docPropsCustomPart);
}
td16 wrote:how can I manipulate data or add data into the same footer?
Error 1
Description: Attribute 'name' should have unique value. Its current value 'Title' duplicates with others.
Path: /op:Properties[1]/op:property[7]
Part: /docProps/custom.xml
docPropsCustomPart.setProperty(propName, propValue)
td16 wrote:Description: Attribute 'name' should have unique value. Its current value 'Title' duplicates with others.
<prop:property name="Title" pid="3" fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}">
<vt:lpwstr>Some Name</vt:lpwstr>
</prop:property>
<prop:property name="Title" pid="8" fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}">
<vt:lpwstr>New Name</vt:lpwstr>
</prop:property>
<prop:property name="Title" pid="8" fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}">
<vt:lpwstr>New Name</vt:lpwstr>
</prop:property>
td16 wrote:nope. still the same error. The old property is updated with new pid and value but it is repeated twice.
Users browsing this forum: No registered users and 23 guests