These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

search xmp data

luciano
Registered: Feb 8 2007
Posts: 23

in acrobat javascript reference: "To use Acrobat JavaScript to search a document’s XMP metadata, set the searchobject’s docXMP property to true, as shown in the following code:
search.docXMP = true;"
is there a way to find a specific xmp data? i'd like to retrieve metadata for a customized field!
for standar fields, such as title, author, keywords, i used the object oDoc with the property info (oDoc.info.title, oDoc.info.author and so on...) now i'd like to refer to each custom property.
i hope to recieve some news about.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
No, this level of granularity is not availible. However you can write your own custom search for the XMP metadata and the Doc Info.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

luciano
Registered: Feb 8 2007
Posts: 23
i understand....
so there isn't a way to implement your custom serach tutorial, i'd like to implemt it in way to retrieve only custom properties i'm finding.
is it possible?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The JavaScript [b]Search[/b] object does not have settings for searching only specific metadata fields. You can see this in the documentation.

However, you can use JavaScript to implement your own search mechanism that only examines specific metadata fields. This is a different technique than the one oulined in the article.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

luciano
Registered: Feb 8 2007
Posts: 23
can you suggest me how i coul refer to search object to retrieve customize properties?
for example i implemented these properties in my script:

Doc.info.DataFattura
oDoc.info.importo
oDoc.info.NumeroDocumento
oDoc.info.RagioneSociale
oDoc.info.tipo_documento

how can i retrieve only pcustom property i serch for?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Again, you cannot use the Search object for this task.

You'll need to write your own function to do the search. How this fucntion is written depends on where and how it will be used. For example, will it be looking at the current PDF? or all the PDFs open in Acrobat? Will it be looking at all the PDFs in a particular folder? Will it be used in conjunction with another feature?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

luciano
Registered: Feb 8 2007
Posts: 23
ok tom, according to my needs i'd like to retrieve documents contained into a folder.
my unique problem is to address search criteria to custom prperties regardless of they are located.
according to their position i'll develop corresponding script.
but before this i've the need to know how to refer them.
Regards.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You already know how to refer to them. You showed me in your previous post

oDoc.info.DataFattura
oDoc.info.importo
oDoc.info.NumeroDocumento
oDoc.info.RagioneSociale
oDoc.info.tipo_documento

This is how the properties are accessed in an open document. This is not the hard part. The hard part is figuring out how you are going to search files in a folder, as opposed to files open in Acrobat. JavaScript does not have direct access to the file system.

But the batch processing engine does. So you can perform this operation in two steps. First, write a batch script that will search the current PDF for the properties you are interested in and if found save the file path to some global area. Then when the batch process is finished you'll need a script to retrieve and display the saved file paths.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script