Skip to main content
frameexpert
Community Expert
Community Expert
August 24, 2011
Answered

Can't set documentTitle to a blank string

  • August 24, 2011
  • 1 reply
  • 627 views

I have a client that wants the documentTitle field to be blank for certain PDFs. If I go to File > File Info (in CS5.5) and delete the Document Title and export a PDF, everything is fine. However, if a Document Title is already set and I try to remove it with JavaScript, it doesn't work:

    doc.metadataPreferences.documentTitle = "";

where doc is my document object. If I set it to any other string it works. I tried setting it to a space:

    doc.metadataPreferences.documentTitle = " ";

but that doesn't work either. Any workarounds would be appreciated. Thank you very much.

Rick Quatro

This topic has been closed for replies.
Correct answer tomaxxi

Hey Rick,

Try setting property directly to XMP:

doc.metadataPreferences.setProperty("http://purl.org/dc/elements/1.1/", "title", "");

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com

1 reply

tomaxxi
tomaxxiCorrect answer
Inspiring
August 24, 2011

Hey Rick,

Try setting property directly to XMP:

doc.metadataPreferences.setProperty("http://purl.org/dc/elements/1.1/", "title", "");

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com

frameexpert
Community Expert
Community Expert
August 24, 2011

Hi Marijan,

This works great! Thank you very much for the quick response. But I have a question: what is the significance of the http://purl.org/dc/elements/1.1/ namespace? How did you know what to use for this? Thanks.

Rick

www.frameexpert.com
tomaxxi
Inspiring
August 24, 2011

Let's say I did a lot of research about a year ago about XMP and it's structure

Take a look at "Raw Data" tab inside "File Info" to find namespaces.

For more info about my research, take a look here: http://tomaxxi.com/?s=XMP

Hope that helps.

--

Marijan (tomaxxi)

http://tomaxxi.com