there might be a way..
as i recall the Document.fonts collection includes the fonts from EMBEDDED vector files, but there is no way of telling the difference between one used in a vector file and the one used by the document itself.
so the solutions is "simple"..
collect all your vector links (doc.allGraphics, and then test each link for the type, to see if it's a vector)
copy them to a new BLANK document
can't realy write the script right now, but it should get you in the right direction.
Sorry for the late reply,
i placed one vector image(pdf file) in a new document and i embeded it and then i run the below script.
var doc = app.activeDocument;
but nothing is showing.
uh.. it has been a long time. can you send me the document you tried on?
(ps, what platform?)
The image is a plain text pdf and im using Indesign CS5.5
@Learner – you could use Acrobat Pro to read out the used fonts of a opened PDF.
again, hm... i remember testing it and working, but now it's not working for me either.
on thing cames to mind (will test it soon) is taht it's not working in CS6 (i'm quite sure i did my inital tests on CS5)
or you could try to read out the fonts from XMP metadata.
1. Load XMP Library
2. Read out XMP metadata from file
var _numberOfFonts = _xmpData.countArrayItems(XMPConst.TYPE_PAGEDFILE,"xmpTPg:Fonts");
_path = XMPUtils.composeArrayItemPath(XMPConst.TYPE_PAGEDFILE,"xmpTPg:Fonts",i);
_fontFamily = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontFamily");
_fontface = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontFace");
_fontType = _xmpData.getStructField(XMPConst.TYPE_PAGEDFILE,_path,XMPConst.TYPE_FONT,"fontType");