Skip to main content
Participant
May 5, 2013 4:21 PM UTC
Answered

Ungrouping an imported pdf into Illustrator

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.

    MartinKehoeCorrect answer
    Participant
    Jun 10, 2025 2:20 PM UTC

    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.");
    }

    10 replies

    MartinKehoeCorrect answer
    Participant
    Jun 10, 2025 2:20 PM UTC

    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.");
    }
    Translate
    Participant
    Jul 30, 2025 12:02 PM UTC

    you're a lifesaver, tysm.

    Translate
    Sep 8, 2017 5:44 PM UTC

    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!

    Translate
    Participant
    Mar 25, 2023 1:28 PM UTC

    Stupid answer!!

     

    Translate
    Participant
    Sep 19, 2023 11:07 AM UTC

    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!

    Translate
    Jacob Bugge
    Community Expert
    Community Expert
    May 5, 2013 4:30 PM UTC

    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?

    Translate
    Participant
    May 5, 2013 4:40 PM UTC

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

    Translate
    _scott__
    Legend
    May 5, 2013 5:28 PM UTC

    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.

    Translate