Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - .join("/")
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

.join("/")

 Post Reply Post Reply
Author
dgams View Drop Down
New Member
New Member


Joined: 18 Jun 2015
Location: Alabama
Points: 3
Post Options Post Options   Quote dgams Quote  Post ReplyReply Direct Link To This Post Topic: .join("/")
    Posted: 18 Jun 2015 at 9:29pm
I have the following code:
// Split Path into an array so it is easy to work with
var aMyPath = this.path.split("/");

// Remove old file name
aMyPath.pop();

// Add new file name
aMyPath.push(this.getField("Name").value + this.getField("AIS#").value + "HC" + ".pdf");

// Put path back together and save
aMyPath.join("/ ");

but the result has "," instead of "/".
dgams
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1113
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jun 2015 at 9:18am
Use:
  aMyPath.join("/");
Back to Top
dgams View Drop Down
New Member
New Member


Joined: 18 Jun 2015
Location: Alabama
Points: 3
Post Options Post Options   Quote dgams Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jun 2015 at 12:48pm
I put the space in thinking it would make a difference. It did not. In fact, I tried other characters such as "@" and the "," spacer still returns.
dgams
Back to Top
dgams View Drop Down
New Member
New Member


Joined: 18 Jun 2015
Location: Alabama
Points: 3
Post Options Post Options   Quote dgams Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jun 2015 at 3:21pm
I changed the code slightly. I put cMypath = aMyPath.join("/"); and cMyPath dose have the correct format.
dgams
Back to Top
BAlheit View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 1113
Post Options Post Options   Quote BAlheit Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jun 2015 at 3:21pm
What version of Adobe Acrobat do you use?
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4109
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 19 Jun 2015 at 5:53pm
I would add some debugging statements to see the intermediate results.
 
function ShowArray(aObj) {
console.println(aObj.length);
for(var i = 0; i < aObj.ength; i++) {
console.println(i + ": " + aObj);
}
console.println(aObj.join(", "));
return;
}
// Split Path into an array so it is easy to work with
var aMyPath = this.path.split("/");
console.println("aMyPath");
ShowArray(aMyPath);
console.println("");
// Remove old file name
aMyPath.pop();
console.println("aMyPath no file name");
ShowArray(aMyPath);
console.println("");
// Add new file name
aMyPath.push(this.getField("Name").value + this.getField("AIS#").value + "HC" + ".pdf");
console.println("aMyPath with new file name");
ShowArray(aMyPath);
console.println("");
// Put path back together and save
aMyPath.join("/ ");
console.println(aMyPath);
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.