Hot Door CORE Forum
how to save document without bringing up a dialog box - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Getting started (http://hotdoorcore.com/forum/forumdisplay.php?fid=6)
+--- Thread: how to save document without bringing up a dialog box (/showthread.php?tid=44)

Pages: 1 2


how to save document without bringing up a dialog box - huangyang - 12-13-2014

I am a new one to Hot Door CORE and try to use it to develop illustrator plug-in. I want to take document saving into my custom file directory without bringing up a dialog box,however the saving method of CurrentDocument Class cannot can not meet my needs. As shown in the picture:
|----------------------------------------|
| |---------------|-------------| |
| |directorypath | selectbutton | |
| |---------------|-------------| |
| |
| |
| |-------------| |
| | save button | |
| |-------------| |
| |
|----------------------------------------|

when clicking on selectbutton,users can choose the saving directorypath of they need ,then click on savebutton ,the document
can be saved into the specified directory without bringing up a dialog box.
I cannot find some class to achieve this function in documentation .


RE: how to save document without bringing up a dialog box - garrett - 12-13-2014

Apologies, I don't think I understand your problem with 100% clarity, but I will do my best.

At the moment, the core::CurrentDocument class only supports saving a document through traditional means using Illustrator's built-in file saving dialog. When you call the CurrentDocument:Confusedave() method, the user will be prompted for information about how/where to save the document if the document has never been saved before. If you call the same method and the document has been saved before, then it will simply be written to disk according to the parameters the user chose the first time they saved the document. We have no control over how/where the document is saved and we have no control over Illustrator's built-in file saving dialog.

Having said that, we are working on an implementation of Illustrator's AIFileFormat suite, which will allow the developer to write the current document to disk in whichever format they want without prompting the user for any information (even if it is the first time the document is being written to disk). Illustrator has some limitations about which formats can be used without any input from the user, but in general a document can be written without user input.

This will probably be in the next release of CORE. If that functionality is what you need, then simply waiting for 0.5.7 will solve your problem. If instead you are looking for a custom file saving UI, then you will need to implement that on your own (and again wait for the AIFileFormat improvements that should be in CORE 0.5.7 so you can actually write the data via your custom UI).

Does that help clarify the situation?


RE: how to save document without bringing up a dialog box - huangyang - 12-14-2014

(12-13-2014, 09:09 PM)garrett Wrote: Apologies, I don't think I understand your problem with 100% clarity, but I will do my best.

At the moment, the core::CurrentDocument class only supports saving a document through traditional means using Illustrator's built-in file saving dialog. When you call the CurrentDocument:Confusedave() method, the user will be prompted for information about how/where to save the document if the document has never been saved before. If you call the same method and the document has been saved before, then it will simply be written to disk according to the parameters the user chose the first time they saved the document. We have no control over how/where the document is saved and we have no control over Illustrator's built-in file saving dialog.

Having said that, we are working on an implementation of Illustrator's AIFileFormat suite, which will allow the developer to write the current document to disk in whichever format they want without prompting the user for any information (even if it is the first time the document is being written to disk). Illustrator has some limitations about which formats can be used without any input from the user, but in general a document can be written without user input.

This will probably be in the next release of CORE. If that functionality is what you need, then simply waiting for 0.5.7 will solve your problem. If instead you are looking for a custom file saving UI, then you will need to implement that on your own (and again wait for the AIFileFormat improvements that should be in CORE 0.5.7 so you can actually write the data via your custom UI).

Does that help clarify the situation?

Hi Garrett,

Thanks for you kindly help!


RE: how to save document without bringing up a dialog box - huangyang - 12-14-2014

(12-13-2014, 09:09 PM)garrett Wrote: Apologies, I don't think I understand your problem with 100% clarity, but I will do my best.

At the moment, the core::CurrentDocument class only supports saving a document through traditional means using Illustrator's built-in file saving dialog. When you call the CurrentDocument:Confusedave() method, the user will be prompted for information about how/where to save the document if the document has never been saved before. If you call the same method and the document has been saved before, then it will simply be written to disk according to the parameters the user chose the first time they saved the document. We have no control over how/where the document is saved and we have no control over Illustrator's built-in file saving dialog.

Having said that, we are working on an implementation of Illustrator's AIFileFormat suite, which will allow the developer to write the current document to disk in whichever format they want without prompting the user for any information (even if it is the first time the document is being written to disk). Illustrator has some limitations about which formats can be used without any input from the user, but in general a document can be written without user input.

This will probably be in the next release of CORE. If that functionality is what you need, then simply waiting for 0.5.7 will solve your problem. If instead you are looking for a custom file saving UI, then you will need to implement that on your own (and again wait for the AIFileFormat improvements that should be in CORE 0.5.7 so you can actually write the data via your custom UI).

Does that help clarify the situation?
hi,garrett
I want to know the time when the CORE 0.5.7 will be released?
Also, I need to convert AI drawing into a rasterised image and send to our system. To do this, I assume we need the AIImageOptSuite, has this function be developed yet?


RE: how to save document without bringing up a dialog box - garrett - 12-15-2014

(12-14-2014, 11:29 PM)huangyang Wrote: I want to know the time when the CORE 0.5.7 will be released?
Also, I need to convert AI drawing into a rasterised image and send to our system. To do this, I assume we need the AIImageOptSuite, has this function be developed yet?

0.5.7 will be released this week.

We have not worked on Adobe's Image Optimization suite, and it is currently a low priority for us. However, you can compile your project against the Illustrator SDK and also compile it (and link it) against CORE with no problem. Follow the instructions in this thread, and then you can fill in any missing functionality from CORE by utilizing the Illustrator SDK itself.


RE: how to save document without bringing up a dialog box - huangyang - 12-15-2014

(12-15-2014, 12:33 PM)garrett Wrote:
(12-14-2014, 11:29 PM)huangyang Wrote: I want to know the time when the CORE 0.5.7 will be released?
Also, I need to convert AI drawing into a rasterised image and send to our system. To do this, I assume we need the AIImageOptSuite, has this function be developed yet?

0.5.7 will be released this week.

We have not worked on Adobe's Image Optimization suite, and it is currently a low priority for us. However, you can compile your project against the Illustrator SDK and also compile it (and link it) against CORE with no problem. Follow the instructions in this thread, and then you can fill in any missing functionality from CORE by utilizing the Illustrator SDK itself.
Thanks, Garrett, I appreciate your taking the time for such a clear and thorough explanation!


RE: how to save document without bringing up a dialog box - garrett - 12-15-2014

No problem Smile

0.5.7 has been released, and now includes the FileFormat class and other supporting methods. I performed some simple file export tests, and everything appeared to work as expected. Let me know if you run into any bugs.


RE: how to save document without bringing up a dialog box - huangyang - 12-22-2014

(12-15-2014, 12:33 PM)garrett Wrote:
(12-14-2014, 11:29 PM)huangyang Wrote: I want to know the time when the CORE 0.5.7 will be released?
Also, I need to convert AI drawing into a rasterised image and send to our system. To do this, I assume we need the AIImageOptSuite, has this function be developed yet?

0.5.7 will be released this week.

We have not worked on Adobe's Image Optimization suite, and it is currently a low priority for us. However, you can compile your project against the Illustrator SDK and also compile it (and link it) against CORE with no problem. Follow the instructions in this thread, and then you can fill in any missing functionality from CORE by utilizing the Illustrator SDK itself.

If I compile against Illustrator SDK and CORE, will it still work on different AI version on cross-platforms? Thanks.


RE: how to save document without bringing up a dialog box - garrett - 12-22-2014

(12-22-2014, 06:56 PM)huangyang Wrote: If I compile against Illustrator SDK and CORE, will it still work on different AI version on cross-platforms? Thanks.

Yes, but it depends on which Illustrator SDK versions you choose to use.

At this time, CORE itself works with Illustrator 13 through 18. If you wanted to use CORE alone, your plugin would work in all of these versions of Illustrator.

If you wanted your plugin to work in all of these versions of Illustrator and use the official SDK too, you would need to compile against all six versions of the SDK. This means you would need a separate build target for each version of Illustrator (which is already the case with CORE alone) and each of these targets would compile against the appropriate version of the official SDK. Your target for Illustrator 18 compiles and links against CORE for AI18 and the SDK for AI18, the next target for Illustrator 17 uses CORE for AI17 and the SDK for AI17, etc.

The official SDK is the same on both platforms, so cross-platform compatibility is maintained.

You might find minor function signature differences between each version of the SDK, or that some suite versions have changed and others haven't, or that some features are missing entirely in one version but not in another, etc. A main design goal of CORE is to abstract away these problems for developers, and obviously you will not have that luxury when using the SDK directly.


RE: how to save document without bringing up a dialog box - huangyang - 12-24-2014

(12-22-2014, 07:35 PM)garrett Wrote:
(12-22-2014, 06:56 PM)huangyang Wrote: If I compile against Illustrator SDK and CORE, will it still work on different AI version on cross-platforms? Thanks.

Yes, but it depends on which Illustrator SDK versions you choose to use.

At this time, CORE itself works with Illustrator 13 through 18. If you wanted to use CORE alone, your plugin would work in all of these versions of Illustrator.

If you wanted your plugin to work in all of these versions of Illustrator and use the official SDK too, you would need to compile against all six versions of the SDK. This means you would need a separate build target for each version of Illustrator (which is already the case with CORE alone) and each of these targets would compile against the appropriate version of the official SDK. Your target for Illustrator 18 compiles and links against CORE for AI18 and the SDK for AI18, the next target for Illustrator 17 uses CORE for AI17 and the SDK for AI17, etc.

The official SDK is the same on both platforms, so cross-platform compatibility is maintained.

You might find minor function signature differences between each version of the SDK, or that some suite versions have changed and others haven't, or that some features are missing entirely in one version but not in another, etc. A main design goal of CORE is to abstract away these problems for developers, and obviously you will not have that luxury when using the SDK directly.

How about, I build a plugin based on CS5 SDK, the functions used remain unchanged in CS6 and CC2014. Do I still need to have 3 separated build versions? The function I will properly use is AIIMageOptSuite, I believe this is just a common function set. Thanks.