List of Fonts used in PDF through Javascript

Hi all,
I need to get the list of fonts used in the PDF and have to change the particular font text to some color across the document using Javascript. As i searched, i didn't get any clue. Using Acrobat Professional 7.0.
Is there any idea plz. share it.
Thanks,
vaasu

You can use a plug-in.
PDFlib FontReporter is a free plug-in that creates a report of fonts used in a PDF.

Similar Messages

  • Programmatically list the fonts used in a PDF

    Hello.
    I want to make a list of all the fonts used in a PDF. After reading (again) the ISO-32000 standard, I tend to think that the only way is to cycle through the pages and list the fonts used in each one.
    Is there any other (and faster) way to do this?

    Nope - that's the only way.
    And don't forget, that you can NOT just look at the Page's Resource dict.  You need to do a full recursive walk down the content stream finding all graphic objects that themselves have resources.  Oh, and don't forget Annotations!

  • Listing all fonts used in a document?

       As I understand it, TextFonts is a collection of all fonts available to Illustraot.  Is there a collection of all fonts used in the open document?  Or would I have to step through every textFrame an create that list myself?

    I don't know why and how you write error log, so I only add a single alert after all. "xmpString" and "XMP library" are two different methods, you only need one of then.
    #target illustrator
    var inputFolder = Folder.selectDialog("Select a folder contains '*.eps' files ");
    if (inputFolder) {
        var fileList = inputFolder.getFiles('*.eps'),
            fontsInfo = [];
        loadXMPLibrary();
        for (var i = 0; i < fileList.length; i++) {
            if (fileList[i] instanceof File && fileList[i].hidden == false) {
                fontsInfo.push(getFontsInfo(fileList[i]));
        unloadXMPLibrary();
    var Loginfo = new File(inputFolder + '/Font.info.txt');
    Loginfo.open('w', 'TEXT', '????');
    var info = fontsInfo.join('\n\n');
    Loginfo.write(info);
    Loginfo.close();
    if (/(Open Type|TrueType)/.test(info)) {
        alert('Open Type / TrueType font found, see log file for details!')
    function getFontsInfo(file) {
        var arr = ['File: ' + decodeURI (file.name)],
            xmpFile, oXmp, fontNumber, i, path, fontname, fonttype, ns = 'http://ns.adobe.com/xap/1.0/t/pg/';
        xmpFile = new XMPFile(file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
        oXmp = xmpFile.getXMP(); //Returns an XMPMeta object
        fontNumber = oXmp.countArrayItems(ns, 'xmpTPg:Fonts');
        xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
        if (fontNumber) { // if there's at least 1 font, proceed
            for (i = 1; i <= fontNumber; i++) {
                path = XMPUtils.composeArrayItemPath(ns, 'xmpTPg:Fonts', i);
                fontname = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontName');
                fonttype = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontType');
                arr.push([i, '. ', fontname, '-', fonttype].join(''));
        return arr.join('\n');
    function loadXMPLibrary() {
        if (!ExternalObject.AdobeXMPScript) {
            try {
                ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            } catch (e) {
                alert('Unable to load the AdobeXMPScript library!');
                return false;
        return true;
    function unloadXMPLibrary() {
        if (ExternalObject.AdobeXMPScript) {
            try {
                ExternalObject.AdobeXMPScript.unload();
                ExternalObject.AdobeXMPScript = undefined;
            } catch (e) {
                alert('Unable to unload the AdobeXMPScript library!');

  • List all fonts used in the illustrator document

    Hi All,
    Having searched google I can't seem to find what I am after but am hoping someone here might be able to help me.
    Due to a recent issue with a designer using a font that wasn't part of the brand guidelines for a particular company we would now like to list all fonts that are used in the illustrator file in a media panel on the document when it is sent for both internal and external approval.
    I know that I can go to find font, save the list, open the document and then copy and paste that list in to a text box in Illustrator, however this is quite time consuming and a bit of a faff.
    What I would like to know is:
    1. Does such a plug in exist that will create a text box in illustrator and just list all the fonts automatically, ideally updating whenever fonts are changed?
    2. If not does anyone have a script that I can run that will do the same thing and just drop a list of all fonts currently live in the document in to a text box?
    I will have the same issue when working with Indesign documents to so if anyone one know the answers to the above but all related to indesign that would also be great!
    Thanks everyone!

    I thought about AdjustObjectAIColors, and its a good way to get a bunch of them but I'm not 100% sure if it covers all colours or just those found in paths. If not, this would exclude colours on effects & overlays for symbols, found in kPluginArt (though there is a similar function for plugin art specifically) and I imagine text. Probably a few other types if we look hard enough. Granted, paths are probably 90% of colours :-) I also wondered (sinc I haven't tried it before) how comprehensive that method is -- does it hit all the colours in various effects & styles layered on path? Or does it just hit the standard stroke & fill? I assume not, but I don't know.

  • Exception thrown while processing pdf file with composite fonts using adobe pdf library (v 9.1 )

    Hi All,
    I have an issue with processing composite fonts with adobe pdf library (v 9.1 ).
    While processing a pdf file having composite fonts, the pdf library is throwing an exception.
    The api which throwed exception is "PDPageAcquirePDEContent()". In my code i am calling PDDocGetNumPages(), PDDocAcquirePage() before this api is called, but all those functions suceeded. In the HANDLER, using the ASGetErrorString(), i got this exception error as  "The encoding (CMap) specified by a font is missing."
    Now coming to the input file (which is also attached), this document have three different composite fonts ( details are given below )
    Font Name : TicketBold, Bold(Embedded)
    Font Type : Trueype (CID)
    Encoding : Identity-H
    Font Name : Times-Roman (Embedded)
    Font Type : Type 1 (CID)
    Encoding : Identity-H
    Font Name : TimesNewRomanPSMT (embedded)
    Font Type : TrueType(CID)
    Encoding: Identity-H
    If i convert all the composite fonts to outline using pitstop before processing, it works fine.
    So my question is that whether pdf library doesnt support composite fonts (which i dont think so ) or i need to do a special handling for these kinds of fonts in my application ( which i strongly belive ). If its the latter case, please let me know how to handle it in my application.
    thanks in advance
    best regards
    ~jafeel

    Hi Leonard,
    Thanks for your reply. May i ask you which sample of the PDF Library you used to test my scenario.
    One question i would like to put to you beofre going for filing a formal issue to Adobe will be does this issue has anything to do with the initialization of the pdf library?
    What i meant is that when we call the PDFLInit() we pass a PDFLDataRec structure which is initialized by various path to font folders, cmap folders and unicode folders. Whether if i miss any of these folders will it cause this issue???
    thanks again
    regards
    ~jafeel

  • List of fonts used

    In iWork06/Pages2, is there a feature for generating a list of all typefaces, fonts, and sizes that have been used in the document? Such a report would be very handy when running a postscript through Distiller to generate press-ready PDF.
    Thank you.
    DW

    Sorry, just realized I was in the wrong forum. Please ignore.

  • Pages report list of fonts used

    I am still using iWork06/Pages2 and not able to find this feature, so:
    In iWork08, is there a feature for generating a list of all typefaces, fonts, and sizes that have been used in the document? Such a report would be very handy when running a postscript through Distiller to generate press-ready PDF.
    Thank you.
    DW

    The function is not there, but it could be done using AppleScript, if someone sits down and writes it.

  • How can I list the fonts used in a Keynote presentation?

    I want to share a Keynote file with a colleague, but I imagine that I've used fonts (typefaces) in my presentation that she does not have.
    How do I list all the fonts I used so that I can share the fonts with her, also?
    Thanks.
    --Larry Anderson   adelarry (at) me (dot) com

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • I currently having problems when dialling with my 4S either from the contacts list, or when using the phone through bluetooth to my in-car system. The phone becomes confused regarding what method / route of connection handsfree, normal use or speaker.

    Hi each time i use my 4S phone a dial from the contact list, the phone will not select a communication mode, either normal speaker or handsfree (car), I have to force the phone into speaker mode and the back to normal mode before I can speak to or listen to anyone. The annoying aspect is the recipient of my call can answer but cannot hear me nor I them.
    What am I doing wrong, or is there an issue with the phone. The same situation occurs when the phone is used with bluetooth in my car, the previous iphone worked perfectly can you please advise.

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • [JS][CS4]List fonts used in the Document

    Hi to all scripting gurus,
    I have this following script that returns a list of fonts used in the document:
    function fontused(){               var fontscoll = document.fonts;               for(var i = 0; i < fontscoll.length; i++){                       var font = fontscoll[i];                       alert(font.name);                } }
    The above is working OK my problem is that it also list the fonts used in the placed illustrator files (.eps). Is there some kind of parameter or something that i can use so that it only list the fonts used in the text?
    -CharlesD

    Charles
    Doesn't time fly?
    This will give you the idea, if when you find more exceptions add them in a likewise manner.
    The "if" statements check that tables, headers, etc. exists otherwise an error will be throw.
    Enjoy
    Trevor
    P.s. I had planned on updating the script after David highlighted the problem, just didn't get round to it.
    // Script to find fonts in documents which are not just in content pasted from illustrator file
    // By Trevor http://forums.adobe.com/message/4807396#4807396
    var   myFonts="",
            uniqueFonts = {}, n;
    if (app.documents[0].stories.everyItem().textStyleRanges.length > 0) fontsIn (app.documents[0].stories.everyItem().textStyleRanges.everyItem().appliedFont)       
    if (app.documents[0].stories.everyItem().tables.length > 0) fontsIn (app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().textStyleRanges.everyItem().appliedFont)
    if (app.documents[0].stories.everyItem().footnotes.length > 0) fontsIn (app.documents[0].stories.everyItem().footnotes.everyItem().textStyleRanges.everyItem().appliedFont)
    for (n in uniqueFonts) myFonts+=(uniqueFonts[n])+"\r";
    alert(myFonts)
    function fontsIn (item)
            var l = item.length;
            while (l--) uniqueFonts[item[l].name] = item[l].name;

  • List missing fonts in Illustrator

    Hi all,
    I've been working on a script to try and build a list of font's that not loaded in Illustrator. I know that Illustrator will alert missing fonts when a document is opened but this routine will be part of a larger script that will have the user dialogs turned off. My process is to build a list of fonts that are available to the the application, then build a list of fonts that are used within the active document and cross reference them to see if there are document fonts that are not in the application fonts list.
    I have used a great function that I believe was posted originally by Moluapple and with some some brilliant advice from the always helpful CarlosCanto I thought that I had found the soultion but it appears to have some limitations. If I get a list of fonts available to the application and the document that I want to cross reference them against is open, the list that's returned contains fonts that are used in the document. Then when I get a list of fonts used in the document and cross reference them they will all be in the application list regardless of whether they're loaded or not.
    The only way that I can get accurate results are if I run the script without any documents open and build a list of application fonts, then open a document and build a list of document fonts and then cross reference. This is the only way I can find out what fonts aren't loaded.
    Does anybody know of another way to build a list of missing fonts without having to close documents first? I have searched through the XMP data and this doesn't seem to give me any clues and I've tried writing the code in applescript but it appears to work in the same way. Any help or comments would be welcome.
    Here's my code:
    #target illustrator
    var doclist = app.textFonts
    var appFontList = new Array ();
    for (i=0;i< app.textFonts.length; i++){
        var fontName = app.textFonts[i].name;
        appFontList[i] = fontName;
    var myfile = File.openDialog ('Choose a file');
    app.open (myfile);
    var docFontsList = getUsedFonts(activeDocument);
    // function accredited to Moluapple
    function getUsedFonts (doc ){
         var xmlString = new XML(doc.XMPString);
         fontsInfo = xmlString.descendants("stFnt:fontName");
         var ln = fontsInfo.length(), arr = [];
         for (var i = 0; i<ln; i++){arr.push(fontsInfo[i])};
         return arr;
    var missingFontsList = checkFonts();
    alert(missingFontsList);
    function checkFonts(){
        var fontArray = new Array ();
        for (i=0; i < docFontsList.length; i++){
            var thisDocFont = docFontsList[i];
            var activeFont = false;
            for (j = 0; j < appFontList.length; j++){
                var thisAppFont = appFontList[j];
                if (thisDocFont == thisAppFont){
                    activeFont = true;
            if (activeFont == false){
                fontArray.push (thisDocFont);
        return fontArray;
    Many Thanks,
    Nik

    Mark,
    you are a legend!!!!
    with yours and Carlos' help I think I have raged against the system that is Adobe and come out victorious!!!!!!!!
    I Finally have a script that doesn't tell me lies.
    Building a list of fonts that are available from InDesign, then building a list of fonts that the active Illustrator document is using and comparing the 2 lists I've managed to locate the fonts that aren't active. I'm sure the script could have some fine tuning but hopefully it might help others who just want to know if fonts are missing before creating a PDF that contains false font information.
    Thanks again all,
    Nik
    #target illustrator
    var docFontsList = getUsedFonts(activeDocument);
    // function accredited to Moluapple
    function getUsedFonts (doc ){
         var xmlString = new XML(doc.XMPString);
         fontsInfo = xmlString.descendants("stFnt:fontName");
         var ln = fontsInfo.length(), arr = [];
         for (var i = 0; i<ln; i++){arr.push(fontsInfo[i])};
         return arr;
    //////////////////////////////////////////get a list of available fonts using Indesign///////////////////////////////////
    var bt = new BridgeTalk;
    bt.target = "indesign";
    var msg = "app.updateFonts();var fonts = app.fonts.everyItem().postscriptName;obj = fonts.toSource();"
    bt.body = msg;
    bt.onResult = function(resObj) {
        eval("var idFontlist = " + resObj.body);
        doSomethingElse(idFontlist);
    bt.send();
    function doSomethingElse(idFontlist) {
        appFontList = idFontlist;
    var missingFontsList = checkFonts();
    if(missingFontsList.length > 0){
        alert("List of missing fonts:\n" + missingFontsList.join( '\r' ));
    else{
        alert("There're no missing fonts!");
    function checkFonts(){
        var fontArray = new Array ();
        for (i=0; i < docFontsList.length; i++){
            var thisDocFont = docFontsList[i];
            var activeFont = false;
    for (j = 0; j < appFontList.length; j++){
                var thisAppFont = appFontList[j];
                if (thisDocFont == thisAppFont){
                    activeFont = true;
            if (activeFont == false){
                fontArray.push (thisDocFont);
        return fontArray;

  • Getting Fonts Used in a PSD

    I'm trying to script some font swapping in PSDs. It mostly works but I discovered a situation where it breaks. If multiples fonts are used on a single text layer, only the first font is listed. I don't know if there is a workaround for this. I've not found one thus far.
    Here's the code I'm using, which I borrowed from a list archive somewhere:
    tell application "Adobe Photoshop CS5"
         tell the current document
              set Used_Fonts to {}
              set Text_Layers to every art layer whose kind is text layer
              repeat with This_Layer in Text_Layers
                   set This_Font to font of text object of This_Layer
                   if This_Font is not in Used_Fonts then
                        set end of Used_Fonts to This_Font
                  end if
              end repeat
         end tell
    end tell
    Used_Fonts
    Thanks in advance for any insight into another method to get this info.
    Stephan

    Does it need to be an Applescript solution?
    The only way I know to get a list of fonts used in a single text layer with multiple fonts is by using Action Manager to get the textItem's descriptor and search the textRanges. Applescript can not use Action Manager directly and I can not recall the way to pass the fonts from javascript to Applescript.
    I can post a javascript/Action Manager function if it would help.

  • PDF Form javascript for making readonly field by using button

    Please let me know the PDF Form JavaScript for making selected fields(Text field,Drop down list,..) as read-only by using Button.

    Do you want your button to be made read only?
    One starts with Acrobat JS Reference.
    // make all fields in a form read only;
    var oField; // variable for field being processed;
    // loop through the form fields;
    for (var i = 0; i < this.numFields; i++) {
    // process each field name;
    oField = this.getField(this.getNthFieldName(i)).readonly = true;

  • Compare two pdf files using adobe acrobat through command line

    Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
    If command line option is not available in acrobat, then is it feasible to make use of acrobat javascript API to do this task?
    Any kind of help will be greatly.

    Command-line: Not possible.
    JavaScript: Possible, but very limited. Basically the only thing you can do is simulate clicking the Compare Documents button. The rest has to be done manually.
    However, it *might* be possible to automate this process a bit more using a plugin. Ask over at the Acrobat SDK forum for more information...

  • Snow Leopard: can't use Adobe PDF printer through Distiller

    I am on Quark 8.1.6.2 and Snow Leopard (10.6.4) and use Acrobat Pro 9.4.
    To make a PDF file I am always used to going through the Quark print dialogue boxes, selecting Adobe PDF as the printer, setting up sizes, settings etc, saving to a .ps file then using Adobe Acrobat Pro (9.4) Distiller to make a high res PDF for press. Worked fine, before I got Snow Leopard.
    I have now read that Adobe PDF Printer is not available on Snow Leopard and that all applications that used Adobe PDF Printer to print pdfs will not be able to print pdfs.
    See this link: http://kb2.adobe.com/cps/509/cpsid_50981.html which only helps InDesign users, not Quark 8 users.
    In the print dialogue box it no longer allows me to set up custom page sizes for a .ps file.
    How do I now print to high res for print PDF (through a .ps file for Distiller). ie, I don't want to export to PDF through the Quark print dialogue, as it makes too big a file, that's why I need to go through Distiller first. Help!

    PDF/X-3 is the best choice to use in those provided by Quark. You can read up on the PDF/X format here. For correct use, version 3 requires all fonts used to be embedded (which the Quark function does automatically). Version 3 also requires all images to be CMYK or spot color. That doesn't mean you can't use it for RGB, though. PDF/X-3 also allows calibrated RGB images and CIELAB.
    I assume for pre-press output I should use ''Press - high quality/high resolution', but then Acrobat Distiller asks for settings too...
    You don't go through Acrobat Pro or the Distiller at all when outputting a PDF from Quark. The function is built in. There are nice, short descriptions of the various PDF choices here.
    When you select a style, the defaults are automatically applied. You will get center and trim marks and whatever else is in the default settings. After you have selected the PDF version you want to use, then click on the Options button. Turn off marks, downsampling of images, or whatever else you want to change. Click the Capture Settings button and Quark will then automatically use your last settings as the method to create PDF files. When clicking the option to capture, you'll be thrown back to the document the first time, so you'll have to go to the menu to choose Layout as PDF again. But you'll see the choice is on Captured Settings. So until you change it, all you have to do is choose a location and click Save.

Maybe you are looking for

  • Imac crashed/need to put itunes back on new computer

    My imac recently crashed. How do I put everything (purchased AND cds) from my ipod back onto the new itunes?

  • Dynamic select --hopefully simple question

    I have read alot of threads on doing a dynamic select. I am have no knowledge of AJAX so this is tough for me. I have looked at Denes and Carl's examples. I have one question and I hope its a simple one. I have two select lists. The second field is d

  • Including multiple resources into response

    In a servlet, I am including a text file and an image seperately using RequestDispatcher.include() method. But when I view the output in the browser, i see the content of the text file along with the content of the image, instead of the image itself.

  • Suddenly placed EPS images in document won't print

    Recently I had to do a clean reinstall of the Mac OS to clear up some problems. I backed up all my files and applications before doing so, so I could move AppleWorks back onto my Mac from the backup. Now I am trying to print out an existing document

  • Problem with crosstable

    Hi, I've a table where the receive of a call is reported. Now I want to have a crosstable, that shows me how many calls are received for every month in every year Year/Month| 1 | 2 | 3 | 4 | 5 | ... 2004 |10|23|34|14|23| ... 2005 | 0 | 14| ... 2006 |