Jump to content

Relative paths & preview


step

Recommended Posts

Is there a reason that preview would break when referencing something via a relative path rather than an absolute path?

 

My folder structure is set up as such:

-_javascript folder

--externaljs.js

-_template folder

--templatefile.pdf

 

OnJobStart Callback:

Load("../_javascript folder/externaljs.js"); // does not allow previews
//Load("/Users/Ste/Desktop/_javascript folder/externaljs.js"); // does allow previews

 

Does anyone have any ideas?

Link to comment
Share on other sites

Well, the search path is set up a bit differently for Preview, since the input file is a temp file with the single record of data. But it should still work, since the template path is the same. So I'm not sure what's wrong. In any case, you can work around the problem using the FusionPro.Composition.isPreview property.
Link to comment
Share on other sites

In any case, you can work around the problem using the FusionPro.Composition.isPreview property.

 

Using the FusionPro.Composition.isPreview property in what capacity?

Like this?

var extjs = (FusionPro.Composition.isPreview) ? "/Users/Ste/Desktop/_javascript folder/externaljs.js" : "../_javascript folder/externaljs.js";
Load(extjs);

Link to comment
Share on other sites

Using the FusionPro.Composition.isPreview property in what capacity?

Like this?

var extjs = (FusionPro.Composition.isPreview) ? "/Users/Ste/Desktop/_javascript folder/externaljs.js" : "../_javascript folder/externaljs.js";
Load(extjs);

Yes, like that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...