Skip to main content
Participant
May 5, 2013
Answered

Ungrouping an imported pdf into Illustrator

  • May 5, 2013
  • 3 replies
  • 41192 views

Is there a way to ungroup the elements of an imported pdf in Illustrator 6? Do you have to change the settings in Adobe Acrobat first to allow the elements to import individually rather than a group? Thank you.

    Correct answer MartinKehoe

    Use this script:

    function releaseAllClippingMasks(doc) {
        var items = doc.pageItems;
        for (var i = items.length - 1; i >= 0; i--) {
            var item = items[i];
            if (item.typename === "GroupItem" && item.clipped) {
                try {
                    item.clipped = false;
                    for (var j = item.pageItems.length - 1; j >= 0; j--) {
                        item.pageItems[j].move(item, ElementPlacement.PLACEATEND);
                    }
                } catch (e) {
                    $.writeln("Error releasing clipping mask: " + e);
                }
            }
        }
    }
    
    function ungroupAll(doc) {
        var changed = true;
        while (changed) {
            changed = false;
            var items = doc.pageItems;
            for (var i = items.length - 1; i >= 0; i--) {
                var item = items[i];
                if (item.typename === "GroupItem") {
                    try {
                        for (var j = item.pageItems.length - 1; j >= 0; j--) {
                            item.pageItems[j].move(item.parent, ElementPlacement.PLACEATEND);
                        }
                        item.remove();
                        changed = true;
                    } catch (e) {
                        $.writeln("Error ungrouping: " + e);
                    }
                }
            }
        }
    }
    
    if (app.documents.length > 0) {
        var doc = app.activeDocument;
        app.executeMenuCommand('unlockAll');
        app.executeMenuCommand('selectall');
        releaseAllClippingMasks(doc);
        ungroupAll(doc);
        alert("All clipping masks released and all groups ungrouped.");
    } else {
        alert("No document open.");
    }

    3 replies

    MartinKehoeCorrect answer
    Participant
    June 10, 2025

    Use this script:

    function releaseAllClippingMasks(doc) {
        var items = doc.pageItems;
        for (var i = items.length - 1; i >= 0; i--) {
            var item = items[i];
            if (item.typename === "GroupItem" && item.clipped) {
                try {
                    item.clipped = false;
                    for (var j = item.pageItems.length - 1; j >= 0; j--) {
                        item.pageItems[j].move(item, ElementPlacement.PLACEATEND);
                    }
                } catch (e) {
                    $.writeln("Error releasing clipping mask: " + e);
                }
            }
        }
    }
    
    function ungroupAll(doc) {
        var changed = true;
        while (changed) {
            changed = false;
            var items = doc.pageItems;
            for (var i = items.length - 1; i >= 0; i--) {
                var item = items[i];
                if (item.typename === "GroupItem") {
                    try {
                        for (var j = item.pageItems.length - 1; j >= 0; j--) {
                            item.pageItems[j].move(item.parent, ElementPlacement.PLACEATEND);
                        }
                        item.remove();
                        changed = true;
                    } catch (e) {
                        $.writeln("Error ungrouping: " + e);
                    }
                }
            }
        }
    }
    
    if (app.documents.length > 0) {
        var doc = app.activeDocument;
        app.executeMenuCommand('unlockAll');
        app.executeMenuCommand('selectall');
        releaseAllClippingMasks(doc);
        ungroupAll(doc);
        alert("All clipping masks released and all groups ungrouped.");
    } else {
        alert("No document open.");
    }
    Participant
    July 30, 2025

    you're a lifesaver, tysm.

    September 8, 2017

    Okay found a solution! (3 years later, lol)

    Steps

    #1. Import PDF

    #2. Click on object (PDF)

    #3. Once selected click embed (Located under File, Edit, Object, Type... Window and help)

    #4. Once embedded, right click object (PDF) and select ungroup.

    Done!

    Participant
    March 25, 2023

    Stupid answer!!

     

    Participant
    September 19, 2023

    This is not a stupid answer, the solution actually works. Thanks to Romello for posting it.

    I have attached a screenshot with the designation of the required button!

    Jacob Bugge
    Community Expert
    Community Expert
    May 5, 2013

    Angie,

    You should be able to Ctrl/Cmd+Shift+G to Ungroup once it is in Illy. If there is a Clipping Mask or something blocking the way, you may release that. You can see it in the Layers palette.

    Illustrator 6

    The one from 1996 or the slightly newer one called CS6/16?

    Participant
    May 5, 2013

    Hello
    Many thanks for that its CS6/16 but it did not work.

    _scott__
    Legend
    May 5, 2013

    If the PDF opens as one big image and can not be ungrouped, then it does not contain vector objects. It's just a big raster image. If you use the Direct Selection Tool (the white arrow) you should be able to select individual objects. If you can't, then it's just a raster image.