Hi Silvia, thanks very much for your answer. I've managed to read the ObjectDefinition, this returns a list of DWFDefinedObjectInstance and I'm adding new properties to these Instances using pInst->addProperty( DWFCORE_ALLOC_OBJECT(DWFProperty(L"my_name", L"my_value", L"my_category")), true );
What I can't find is a way to save the modifications to the DWF and the ObjectDefinition. What's the correct way to do this?
You can save the new object definition resource by DWFObjectDefinitionResource::serializeXML; here is a code snapshot:
DWFPointer<DWFBufferOutputStream> apOutputStream( DWFCORE_ALLOC_OBJECT(DWFBufferOutputStream(_DWFTK_
DWFPointer<DWFXMLSerializer> apSerializer( DWFCORE_ALLOC_OBJECT(DWFXMLSerializer(oUUID)), false );
apSerializer->attach( apOutputStream );
objectdefinitionresource->serializeXML( apSerializer, DWFPackageWriter::eObjectDefinition );
The code is to create a new stream of the object definition resource; then you can create a new DWFObjectDefinitionResource and attach the new stream.
Access a broad range of knowledge to help get the most out of your products and services.