Highlighted

passing web argument to pdf

New Here ,
Jul 12, 2020

Copy link to clipboard

Copied

Hey,

 

I'm currently checking out the adobe sdk sampleclient-php-soap.

It works so far, but I want to extend it's functions by passeing the arguments to a textframe in the .pdf file.

The pdf file just prints **not_defined** for the argument that was passed by me over the browser.

 

Below's my code:

var notDefined = "**not_defined**";
var myArg0 = app.scriptArgs.getValue("arg0");
var myResult = "arg0:  " + myArg0;

var myFile = new File(Folder.desktop + "/design.indd");
var myDocument = app.documents.add();
var textFrame  = myDocument.textFrames.add();
var myDocPreset = app.pdfExportPresets.item("[High Quality Print]");
var myExportedPDF = new File(Folder.desktop + "/ExportedPDF.pdf");

textFrame.properties =
{
    geometricBounds : [ 0,0,100,100 ],
    strokeWidth : 2,
    fillColor : "None",
    contents : myResult
};

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

How did you define that scriptArg?

Did you use method set() somehow before?

 

See DOM documentation:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ScriptArg.html

 

FWIW: Personally I never worked with that feature.

 

Regards,
Uwe Laubender

( ACP )

Topics

Import and export, Scripting, SDK

Views

46

Likes

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

passing web argument to pdf

New Here ,
Jul 12, 2020

Copy link to clipboard

Copied

Hey,

 

I'm currently checking out the adobe sdk sampleclient-php-soap.

It works so far, but I want to extend it's functions by passeing the arguments to a textframe in the .pdf file.

The pdf file just prints **not_defined** for the argument that was passed by me over the browser.

 

Below's my code:

var notDefined = "**not_defined**";
var myArg0 = app.scriptArgs.getValue("arg0");
var myResult = "arg0:  " + myArg0;

var myFile = new File(Folder.desktop + "/design.indd");
var myDocument = app.documents.add();
var textFrame  = myDocument.textFrames.add();
var myDocPreset = app.pdfExportPresets.item("[High Quality Print]");
var myExportedPDF = new File(Folder.desktop + "/ExportedPDF.pdf");

textFrame.properties =
{
    geometricBounds : [ 0,0,100,100 ],
    strokeWidth : 2,
    fillColor : "None",
    contents : myResult
};

 

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

How did you define that scriptArg?

Did you use method set() somehow before?

 

See DOM documentation:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ScriptArg.html

 

FWIW: Personally I never worked with that feature.

 

Regards,
Uwe Laubender

( ACP )

Topics

Import and export, Scripting, SDK

Views

47

Likes

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
Jul 12, 2020 0
Adobe Community Professional ,
Jul 14, 2020

Copy link to clipboard

Copied

How did you define that scriptArg?

Did you use method set() somehow before?

 

See DOM documentation:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ScriptArg.html

 

FWIW: Personally I never worked with that feature.

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Reply
Loading...
Jul 14, 2020 0