Export indesign linked files as pdf files?
have script export linked files in indesign document pdf @ size in indesign?
i need start moving lot of links lots of files platform web deployment , format accepts pdf.
here's script exports linked files in active document pdf except pdf , link invalid. uses [press quality] pdf preset, can change in line 21.
peter
(function () { function getlinks () { var listok = []; var listnotok = []; var links = app.documents[0].links.everyitem().getelements(); (var = 0; < links.length; i++) { if (/\.pdf$/i.test(links[i].filepath) === false) { if (links[i].status === linkstatus.normal) { listok.push (links[i].filepath); } else { listnotok.push (links[i].filepath); } } } return {listok: listok, listnotok: listnotok} } function exportlinksaspdf (list) { var placed; var preset = app.pdfexportpresets.item ('[press quality]'); app.documents.add(); (var = 0; < list.length; i++) { placed = app.documents[0].pages[0].place (file(list[i]), [0,0], undefined, false)[0]; app.documents[0].pages[0].resize (coordinatespaces.inner_coordinates, anchorpoint.top_left_anchor, resizemethods.replacing_current_dimensions_with, [placed.geometricbounds[3], placed.geometricbounds[2]]); app.documents[0].exportfile (exportformat.pdf_type, file (list[i].replace (/^(.+\.).+/, '$1pdf')), false, preset); placed.parent.remove(); } app.documents[0].close (saveoptions.no); } var lists = getlinks(); exportlinksaspdf (lists.listok); if (lists.listnotok.length > 0) { alert ('unable export following links: \r' + lists.listnotok.join('\r')); } }());
More discussions in InDesign Scripting
adobe
Comments
Post a Comment