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

unable to load new images to extension from illustrator after saving from illustrator

Explorer ,
Nov 02, 2017 Nov 02, 2017

Copy link to clipboard

Copied

Hi,

the issue is that i need to open .ai files in illustrator and am able to do that. what ever files that i open in illustrator, those should be opened in an extension which we developed, and i am able to do that. the below extension snippet.

Capture.PNG

Now whats the issue is when i edit an image in illustrator and and able to save them and not able to load to this newly saved files. it is always loading the old files. but   if i close the illustrator and try loading it am able to load it successfully.

tried all the ways.

someone pleases help me with this.

TOPICS
SDK

Views

2.3K

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

correct answers 1 Correct answer

Advocate , Nov 08, 2017 Nov 08, 2017

Try replacing:

exportArtboard.fileName= unescape(base_filename.replace('/c/','/'));

With:

exportArtboard.fileName= unescape(base_filename.replace('/c/','/')) + "?stamp=" + Date.now();

Votes

Translate

Translate
Adobe
Adobe Employee ,
Nov 03, 2017 Nov 03, 2017

Copy link to clipboard

Copied

moved to Illustrator SDK​

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
Explorer ,
Nov 05, 2017 Nov 05, 2017

Copy link to clipboard

Copied

Thank you so much..

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
Advocate ,
Nov 05, 2017 Nov 05, 2017

Copy link to clipboard

Copied

When you say "when i edit an image in illustrator", are you talking about linked/embedded images or any art object?

How does your plugin load the illustrator files? What happens if the user closes and then reopens the file in Illustrator after modifying it, do you get the modified version then?

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
Explorer ,
Nov 05, 2017 Nov 05, 2017

Copy link to clipboard

Copied

1. when i edit an image in illustrator means its an art object i.e .ai image

2. how does my illustrator files: those files are first loaded into a folder and then to the extension.

3. i am not  getting  the modified version just closing  and reopening  the file but by closing the and opening the abode illustrator

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
Advocate ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/ananth+padmakarp64550037  wrote

2. how does my illustrator files: those files are first loaded into a folder and then to the extension.

So your extension has its own copy of the files? When do the files get loaded into the folder? Does your extension open the file in Illustrator when it opens an ai file, or does it do it in the background?

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
Explorer ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

my extension doesnt have its own copy. when a .ai file is opened in illustrator first it gets placed in a local folder. now the images which are in folder are loded into the extension.

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
Advocate ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

https://forums.adobe.com/people/ananth+padmakarp64550037  wrote

my extension doesnt have its own copy. when a .ai file is opened in illustrator first it gets placed in a local folder. now the images which are in folder are loded into the extension.

How does it get placed in a local folder? What code do you use to load the file into your extension?

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
Explorer ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

the files which are opened in illustrator, we retrive the path of that file and create a .png extension for these files and are loaded to folder. and not by getting the  paths for all the files in the folder as an object and  we display it from html side using ng-repeat in image tag

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
Advocate ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

So if the user modifies a file, you create a new version of the png file with the same name?

If so, your problem is probably that the html panel is not reloading the image because it is cached. Try saving the file with a different name or add a query string with a time stamp to the image src, e.g.

<html>

<head>

<script type="text/javascript">

function updateImages()

{

var noupdate = document.getElementById("noupdate");

noupdate.src = "test.png";

var willupdate = document.getElementById("willupdate");

willupdate.src = "test.png?stamp=" + Date.now();

}

</script>

</head>

<body>

<img id='noupdate' src='test.png'/>

<img id='willupdate' src='test.png' />

<button onclick="updateImages()">Update</button>

</body>

</html>

Load this web page in a folder that has an image called test.png. Then modify the test.png file and click the Update button on the web page.

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
Explorer ,
Nov 07, 2017 Nov 07, 2017

Copy link to clipboard

Copied

Thanks for the suggestion bro. i have tried your logic in a different manner before adding time stamp. But whats the problem is our client don't want the time stamp included in the name of the file. They have given us some naming convention for the file. Thats why.  i need some other solution.

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

You son't need to change the filename if you use the time stamp in the query string of the image src as shown in the example html.

Example:

File name: "test.png"

Image src: "test.png?stamp=1510128384"

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

could you please explain me a bit clear. i did assumed that code in a different way.

or else this is my gmail id: padmakar0000@gmail.com

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

What is your code that loads the image into the html panel?

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

when saved control jumps to jsx file and the function is belowcore.PNG

and that prepares an object and the file name is used to link the image in image source. that looks like this.

html.PNG

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

Try replacing:

exportArtboard.fileName= unescape(base_filename.replace('/c/','/'));

With:

exportArtboard.fileName= unescape(base_filename.replace('/c/','/')) + "?stamp=" + Date.now();

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

tried adding the time stamp but its not loading into extension. showing empty page

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

I just tried adding a query string with a timestamp to an img src attribute in an Illustrator html panel and it worked fine, so you need to debug your application to see where it is going wrong.

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

that file name contains a path to the image that we want to show. and while binding the  image the file name is converted base64

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

Why would you convert the file name to base64? Do you mean the contents of the file are converted to base64? If so, then I don't see why you have the update problem as the base64 will be different if the image has changed.

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

base64 conversion is just for storage purpose

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

So you mean the file contents and not the file name is converted. What is the code that does the base64 conversion? Does it include some form of caching based on the filename?

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

Bro, that worked fine. Thank you so much. There is  a bug in that and that's the problem.Now its working fine.

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
Explorer ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

And how did you get such an idea of adding time stamp to the image src..?

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
Advocate ,
Nov 08, 2017 Nov 08, 2017

Copy link to clipboard

Copied

It's a trick I came up with a long time ago to solve a similar problem.

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