Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 85594

Re: Re: Is that possible to write a script for export underline text to PDF?

$
0
0

Hi HarveyLiu,

 

Does this you ask? It will export the pages which have underlined text.

 

var doc = app.documents;
app.findTextPreferences = null;
app.findTextPreferences.underline = true;
for(var i=0;i<doc.length;i++)
{        var found = doc[i].findText();        var _pages = [];        for(var j=0;j<found.length;j++)        {                var txfms = found[j].texts[0].parentTextFrames;                for(var k=0;k<txfms.length;k++)                {                        _pages.push(txfms[k].parentPage.name);                    }            }        for(var j=0;j<_pages.length;j++)        {                if(_pages[j] === _pages[j-1])                {                        _pages.splice(j,1);                    }            }        if(_pages.length != 0)        {                app.pdfExportPreferences.pageRange = _pages.toString();                doc[i].exportFile(ExportFormat.PDF_TYPE, new File(doc[i].fullName.toString().replace(/\.indd$/i,".pdf")), false);            }        _pages = [];    }
app.findTextPreferences = null;

 

Regards,

Chinna


Viewing all articles
Browse latest Browse all 85594

Trending Articles