• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do I make the guide layers visible on a placed Illustrator image when exported to PDF?

New Here ,
Dec 01, 2016 Dec 01, 2016

Copy link to clipboard

Copied

What I have now roughly is as follows:

// Open a new document, store a reference to it

document = app.documents.add();

// Place graphic on page

var graphic = document.pages.item(0) .place(File("C:\input.ai"))[0];

// PSD/AI with only 1 layer may not have this property available

if(!graphic.graphicLayerOptions)

{

  return;

}

var layerOptions = graphic.graphicLayerOptions;

// Iterate the layers and set every layer to visible.

for(i = 0; i < layerOptions.graphicLayers.count(); i++)

{

  layerOptions.graphicLayers.item(i).currentVisibility = true;

}

// Export using predefined presets

var preset = app.pdfExportPresets.item("<export_preset>");

preset.exportGuidesAndGrids = true;

preset.exportLayers = true;

preset.exportNonprintingObjects = true;

preset.exportWhichLayers = ExportLayerOptions.EXPORT_ALL_LAYERS;

// Export the file.

document.exportFile(ExportFormat.pdfType, File("C:\result.pdf"), preset, false, "", true);

The problem is that none of the guide layers are visible, even though I'm toggling all layers on.

Any InDesign scripters know why this isn't doing what I think it should?

TOPICS
Scripting

Views

222

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation