Skip to main content
Inspiring
April 27, 2019
Question

Embed Snip Tool image in InDesign

  • April 27, 2019
  • 3 replies
  • 2812 views

Hi,

I was working on a few documents which had images picked up by Snip Tool without any file format, in essence, the images were snipped using Snipping Tool and pasted directly in InDesign without saving the image in JPG or PNG format through Snipping Tool, before hand.

InDesign considers such an image as a graphic object but since the image was pasted directly, it doesn't show the image in "Links" palette.

Such images lead to "Transparency" error while exporting document in PDF/X1:2001 compliant form.

Is there any way of correcting the image in InDesign itself, so that the Transparency error goes away? Any kind of help would be highly appreciated.

Thanks & Regards,

Aman Mittal

This topic has been closed for replies.

3 replies

Stephen Marsh
Community Expert
April 27, 2019
amanm5143Author
Inspiring
April 29, 2019

Hi Stephen,

Thank you for replying to the thread and coming up with such an amazing solution. I had tried this script earlier and it works wonders, given it was developed by Mr. Kahrel (a known name in InDesign community). Only issue I have been facing with this is that it removes linking for embedded images as well. Also, when I relink the pasted images, it changes the size of the pasted images. It adds a bit of blank frame at the end of pasted images. Hence, I have not been able to figure out the issue with this. Other than that, the script is amazing.

Thank you for taking out the time and putting up with such a great solution. And, Mr. Kahrel has been amazing, as always.

Thanks & Regards,

Aman

Stephen Marsh
Community Expert
April 29, 2019

Here is a copy of the first script from 2010 if that helps:

//DESCRIPTION: "Unpaste" pasted images

// Peter Kahrel -- www.kahrel.plus.com

// Pasted images (i.e. images without a link in the Links panel)

// are written on disk in a subdirectory of the current document's folder.

// The subdir is called "/images".

// Images can be linked or deleted

#target indesign;

try {if (app.documents.length > 0)

        unembed_images ()}

    catch (e) {alert (e.message + "\r(line " + e.line + ")")};

function unembed_images ()

    {

    var doc = app.documents[0];

    var output_folder = subdir (doc) + "/" + doc.name + "_unembedded_";

    var export_data = get_format ();

    var g = doc.allGraphics;

    var image_file;

    var n = 0;

    for (var i = g.length-1; i > -1; i--)

        {

        if (g.itemLink == null)

            {

            image_file = File (output_folder + String (n++) + export_data.extension);

            if (export_data.extension == ".EPS")

                export_eps (g, image_file);

            else

                g.exportFile (export_data.enum_type, image_file);

            if (export_data.create_link)

                g.parent.place (image_file);

            else

                g.parent.remove ();

            }

        }

    }

function get_format ()

    {

    var export_enums = [ExportFormat.epsType, ExportFormat.jpg, ExportFormat.pngFormat];

    var w = new Window ("dialog", "Save pasted images");

    w.alignChildren = "left";

        var g1 = w.add ("panel");

            g1.orientation = "row";

            g1.add ("statictext", undefined, "Export format: ");

            format_ = g1.add ("dropdownlist", [0,0,160,22], ["EPS", "JPEG", "PNG"]);

        var link = w.add ("checkbox", undefined, " Create links\u00A0");

        var buttons = w.add ("group");

            buttons.alignment = "right"

            buttons.add ("button", undefined, "OK", {name: "ok"});

            buttons.add ("button", undefined, "Cancel", {name: "cancel"});

    var previous = read_history ("/unembed_images.txt");

    format_.selection = previous.format;

    if (previous.create_links)

        link.value = true;

   

    if (w.show () == 1)

        {

        w.close ();

        write_history ("/unembed_images.txt", "Format="+format_.selection.index+"\rLink="+link.value);

        return {extension: "." + format_.selection.text,

                    enum_type: export_enums [format_.selection.index],

                    create_link: link.value};

        }

    else

        {

        w.close ();

        exit ();

        }

    }

function subdir (doc)

    {

    try {var doc_path = String (doc.filePath)}

    catch (e)

        {

        alert (e.message);

        exit ()

        }

    var temp = doc_path + "/images";

    if (!Folder (temp).exists)

        Folder (temp).create ();

    return temp

    }

function export_eps (im, f)

    {

    var gb = im.parent.geometricBounds;

    var d = app.documents.add (false);

    // Separate try-catch-finally here (apart from the global one)

    // to make sure that we don't end up with documents without a layout window

    try

        {

        d.documentPreferences.pageHeight = gb[2] - gb[0];

        d.documentPreferences.pageWidth = gb[3] - gb[1];

        var dupl = im.parent.duplicate (d.pages[0]);

        dupl.move ([0, 0]);

        dupl.exportFile (ExportFormat.epsType, f);

        }

    catch (_) {}

    finally {d.close (SaveOptions.no)}

    }

function read_history (fstring)

    {

    var f = File (app.scriptPreferences.scriptsFolder + fstring);

    if (f.exists)

        {

        f.open ("r");

        var temp = f.read ();

        f.close ();

        return {format: temp.match (/Format=(\d)/)[1],

                    create_links: eval (temp.match (/Link=(.*)/)[1]) }

        }

    else

        return {format: 1,

                    create_links: true };

    return temp

    }

function write_history (fstring, num)

    {

    var f = File (app.scriptPreferences.scriptsFolder + fstring);

    f.open ("w");

    f.write (String (num));

    f.close ();

    }

BobLevine
Community Expert
April 27, 2019

What kind of error are you getting. Those are just RGB embedded images and shouldn’t be an issue, though PDF/X-1a is a horribly archaic file format.

amanm5143Author
Inspiring
April 27, 2019

Hi Bob,

Thank you for replying to the thread. I agree that PDF/X1: 2001 format is archaic however, it is one of the mandatory requirements from the printer's side. When I export the document to such a format, the pasted images come in a blue highlight instead of their original form.

The dark blue colour covers the entire image and acts as a background because of the transparency error with PDF/X1:2001 compliance (The content of the image was edited).

Hence, I was wondering if there was a way to find and embed the pasted images from InDesign within InDesign itself? Or any other way of solving this transparency problem?

Thank you for helping out!

Regards,

Aman

BobLevine
Community Expert
April 27, 2019

What's the transparency blend space set to?

amanm5143Author
Inspiring
April 27, 2019

Basically, embedding pasted image (not placed) in Indesign!