From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Populate exported PDF metadata from Script

Hi all,

 

I would like to pull select properties from my tdm files and embed them in the XMP metadata stream in the exported pdf file in order to improve integration with a document management system.  Does anyone know of a way to do this without writing a XML parser from scratch?

 

Thanks.

CLAD
0 Kudos
Message 1 of 4
(5,649 Views)

Hi testingHotAir,

 

I don’t think there’s any way to do this directly through DIAdem. That is, the Report doesn’t contain any options or properties that I can find to edit the metadata that would be exported to the PDF...

 

Kelsey Johnson

Applications Engineer

0 Kudos
Message 2 of 4
(5,610 Views)

TestingHotAir

 

This seemed interesting so, looked up ways to alter the XMP file from vbscript, (which can be ran from DIAdem after the Pdf is made.)

 and put values from DIAdem's data portal into XMP meta information.

 

The script below looks like it could be modified to do what you want.

 

Paul

 

set xmp = CreateObject("Chilkat.Xmp")

success = xmp.UnlockComponent("Anything for 30-day trial.")
If (success <> 1) Then
    MsgBox xmp.LastErrorText
    WScript.Quit
End If

' The first step is to create a new XMP document, which is nothing
' more than XML. The NewXmp method returns an XML document with
' the standard XMP boilerplate.
' xml is a Chilkat.Xml
Set xml = xmp.NewXmp()

' Add some properties...
success = xmp.AddSimpleStr(xml,"Iptc4xmpCore:Chilkat","Blah blah")
' If you wish to view the XML, save it to a file and review it
' with a text editor:
success = xml.SaveXml("newXmp.xml")
If (success <> 1) Then
    MsgBox xml.LastErrorText
    WScript.Quit
End If

' To add the XMP to the JPG (or TIFF), simply load the JPG,
' append the XMP, and save:
success = xmp.LoadAppFile("scream.jpg")
If (success <> 1) Then
    MsgBox xmp.LastErrorText
    WScript.Quit
End If

success = xmp.Append(xml)
If (success <> 1) Then
    MsgBox xmp.LastErrorText
    WScript.Quit
End If

success = xmp.SaveAppFile("screamOut.jpg")
If (success <> 1) Then
    MsgBox xmp.LastErrorText
    WScript.Quit
End If

Message 3 of 4
(5,602 Views)

Thanks Pesmith8.

 

Unfortunately it seems that library only handles xmp data for tiff and jpeg files, not pdfs.  I'm still looking for a similar tool that would support pdf.  I'm kinda surprised there isn't one shipped with Acrobat Pro (which I have).

CLAD
0 Kudos
Message 4 of 4
(5,578 Views)