GroupDocsGists
10/19/2017 - 11:27 AM

UpdateBasicJobTicketXmpPropertiesGifImage.vb

' For complete examples and data files, please go to https://github.com/groupdocsmetadata/GroupDocs_Metadata_NET
' initialize GifFormat
Dim gifFormat As New GifFormat(Common.MapSourceFilePath(filePath))

' get xmp data
Dim xmp = gifFormat.GetXmpData()

Dim package As BasicJobTicketPackage = Nothing

' looking for the BasicJob schema if xmp data is presented
If xmp IsNot Nothing Then
    package = TryCast(xmp.GetPackage(Namespaces.BasicJob), BasicJobTicketPackage)
Else
    xmp = New XmpPacketWrapper()
End If

If package Is Nothing Then
    ' create package if not exist
    package = New BasicJobTicketPackage()

    ' and add it to xmp data
    xmp.AddPackage(package)
End If

' create array of jobs
Dim jobs As Job() = New Job(0) {}
jobs(0) = New Job() With { _
     .Id = "1", _
     .Name = "test job" _
}

' update schema
package.SetJobs(jobs)

' update xmp data
gifFormat.SetXmpData(xmp)

' commit changes
gifFormat.Save(Common.MapDestinationFilePath(filePath))