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

Why display message confirm save after ExecuteThisJavascript?

Enthusiast ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

Dim iTotalPage = gPdDoc.GetNumPages

For iPage = 0 To iTotalPage - 1

        Dim formApp As AFORMAUTLib.AFormApp

        formApp = CreateObject("AFormAut.App")      

        Dim fields As AFORMAUTLib.Fields

        fields = formApp.Fields

        Dim strScript As String

        Dim tmp = "var p=" & iPage & ";" & vbNewLine

        strScript = tmp & System.IO.File.ReadAllText("Script.txt")

        ' call the method to execute JavaScript

        fields.ExecuteThisJavascript(strScript)             

Next

[Script.txt] process add link to target page.

After call process of Page=0, it display message confirm save. i not call command close document.

I repaired a document that was not properly saved before Adobe Acrobat shut down. To open the restored document, click "Yes". If you click "No", changes will be lost.

Why?

TOPICS
Acrobat SDK and JavaScript

Views

374

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
Community Expert ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

It would be helpful if we knew what your code actually does...

Votes

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
Enthusiast ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

this my script:

//for (var p = 0; p < this.numPages; p++)

//{

    var numWords = this.getPageNumWords(p);

var bLink=false;

    for (var i=0; i<numWords; i++)

    {

            var ckWord = this.getPageNthWord(p, i, false);

            if ( ckWord == "P."))

            {

 

var q = this.getPageNthWordQuads(p, i);

m = (new Matrix2D).fromRotated(this,p);

mInv = m.invert();

r = mInv.transform(q);

r=r.toString();

r = r.split(",");

var q2 = this.getPageNthWordQuads(p, i+1);

m2 = (new Matrix2D).fromRotated(this,p);

mInv2 = m2.invert()

r2 = mInv.transform(q2);

r2=r2.toString();

r2 = r2.split(",");

l = addLink(p, [r[4], r[5], r2[2], r2[3]]);

l.borderColor = color.red;

l.borderWidth = 1;

l.setAction("this.pageNum = 1" );

            }

    }

//}

Votes

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
LEGEND ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

I don’t know the cause but the form OLE objects are global and should be instantiated only once, outside the loop.

Votes

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
Enthusiast ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

i had try move to outside loop:

Dim formApp As AFORMAUTLib.AFormApp

formApp = CreateObject("AFormAut.App")     

Dim fields As AFORMAUTLib.Fields

ields = formApp.Fields

result: i run time 1 it is ok.

But if i run again, it will show message confirm save, after ExecuteThisJavascript some Pages.

Votes

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
Enthusiast ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

Can Acrobat set not show any message box? (the same setting UserInteractionLevel of Indesign)

Votes

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
Community Expert ,
Feb 02, 2018 Feb 02, 2018

Copy link to clipboard

Copied

LATEST

No. That's not possible in Acrobat.

Votes

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