I can use the below to get some of what meta data I need from a placed PDF in Indesign CS5.5, ie page height, width, apart from the colours used, the question is what would I use/add to get the colours used in the PDF?
set my_PDF to POSIX path of (choose file)
do shell script "mdls " & quoted form of my_PDF
mdls is a command to read the Spotlight metadata added to files as they are imported by a Spotlight importer. If the metadata wasn’t added, you can’t get it – and and the list of colours isn’t. I don’t think sips will give it to you, either.
What you might be able to do is delete the colours in an InDesign document, add the PDF, and see what colours were added.
if a swatch is added to the document when importing a PDF the swatch will be protected.
So may be a work around which tries to remove a swatch will do the job.
Sorry for the JS, but I’m not on a mac this evening …
var mySwatchList = [];
var mySwatches = app.activeDocument.swatches;
for(var i = mySwatches.length -1; i >= 0; i--)
{
var mySwatch = mySwatches[i];
try{
mySwatch.remove()
app.activeDocument.undo()
}catch (e){
var swatchName = mySwatch.name
if(swatchName != 'Paper' && swatchName != 'Registration' && swatchName != 'None' && swatchName != 'Black')
myList.push(swatchName)
}
}