Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2009, 02:57 PM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default editing images on-the-fly

Hi guys,
I need to develop an app which has to edit/build in run-time an image, it must to be able to add arrows, text boxes, cut, rotate, etc.. and finally save the image as Jpeg. However, user will be able to edit the image/template, changing the arrows, text, etc...

In fact, the edition is the capability which I think is more complicated, because my understand is system has to save the template in a own format, like power point, in order user can move the arrows, etc...

You thinks is possible to embed an POwerPoint object into the app and enable the user all capabilities of PowerPoint?

Thanks in advance, any help is welcome.
 
Old April 27th, 2009, 04:35 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

You should be able to "script" powerpoint, but it will be a *VERY VERY VERY* tedious operation. You just start from:
Code:
Set pp = Server.CreateObject("PowerPoint.Application")
But after that it gets hairy.

First of all, unless I'm mistaken, that creates PP as an "out of process" executable, which means if something goes wrong in your scripting the process won't be terminated on the server. Not sure on that.

But anyway, now you have to use VBScript to script *ALL* the objects in PP, using the same kinds of calls you would if you were using VBA within PP, but without the type-safety protection and without any way of knowing when something goes wrong excepting for the miniscule error handling that VBScript gives you.

Yes, people *have* done this. Most of the time, people script either MS Word or MS Excel, but the principles are the same.

Having said all this...

You might well be much better off using an imaging component, instead. Yes, you will have to have your own data structure (presumably saved in a database) to save the presentation in an editable format. But unless you really NEED all the PP capabilities, it might be much easier to do this.

Note that you *will* still need an imaging component. For example, AspJpeg from Persits Software ( http://www.AspJpeg.com ).

Oh...one more consideration: If you are running on a shared web host, you may not have any choice in the matter. For example, my websites are hosted by GoDaddy.com, and I can *NOT* use out-of-process components such as PowerPoint. I can, however, use the AspJpeg that is included in the hosting package.

FINALLY... If this kind of image manipulation is really important to you, it might well be worth learning ASP.NET, at least to the point of learning how to do image manipulation. Image handling is built-in to the .NET framework, so you don't need a separate component and you can develop code on your own machine and host it with any .NET host.

Hope all that is enough to help you in one direction or another.
 
Old April 27th, 2009, 10:44 PM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Old Pedant,

Quote:
Originally Posted by Old Pedant View Post
You should be able to "script" powerpoint, but it will be a *VERY VERY VERY* tedious operation. You just start from:
Code:
Set pp = Server.CreateObject("PowerPoint.Application")
But after that it gets hairy.

First of all, unless I'm mistaken, that creates PP as an "out of process" executable, which means if something goes wrong in your scripting the process won't be terminated on the server. Not sure on that.

But anyway, now you have to use VBScript to script *ALL* the objects in PP, using the same kinds of calls you would if you were using VBA within PP, but without the type-safety protection and without any way of knowing when something goes wrong excepting for the miniscule error handling that VBScript gives you.

Yes, people *have* done this. Most of the time, people script either MS Word or MS Excel, but the principles are the same.
I wonder if embedding an excel, word or powerpoint into the ASP Classic Page is possible, because AFAIK, you can use the methods, properties, etc.. of the COM Object but I did not see some example which displays an instance of Powerpoint or Excel.

Any comments?

Quote:
Having said all this...

You might well be much better off using an imaging component, instead. Yes, you will have to have your own data structure (presumably saved in a database) to save the presentation in an editable format. But unless you really NEED all the PP capabilities, it might be much easier to do this.

Note that you *will* still need an imaging component. For example, AspJpeg from Persits Software ( http://www.AspJpeg.com ).
I have evaluated this components but none of them support drag & drop, like PP. (Including ASPJpeg). So, I will be glad if you know someone which supports this feature.

Quote:
Oh...one more consideration: If you are running on a shared web host, you may not have any choice in the matter. For example, my websites are hosted by GoDaddy.com, and I can *NOT* use out-of-process components such as PowerPoint. I can, however, use the AspJpeg that is included in the hosting package.
This is not a problem because it will be achieved in a intranet.

Quote:
FINALLY... If this kind of image manipulation is really important to you, it might well be worth learning ASP.NET, at least to the point of learning how to do image manipulation. Image handling is built-in to the .NET framework, so you don't need a separate component and you can develop code on your own machine and host it with any .NET host.

Hope all that is enough to help you in one direction or another.
Yep, I know but this feature (Img edition) will belong to an app which is compiled using Classic ASP therefore, change to ASP.net (or another technology) is not an option.

Thanks a lot for your comments,
 
Old April 28th, 2009, 12:21 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Quote:
I wonder if embedding an excel, word or powerpoint into the ASP Classic Page is possible, because AFAIK, you can use the methods, properties, etc.. of the COM Object but I did not see some example which displays an instance of Powerpoint or Excel.
No, no. You can't *DISPLAY* anything from one of these object embedded in ASP code. Even if you could, the display would only appear *ON THE WEB SERVER* machine...thereby annoying the hell out of your system administrator.

No, when people script Word or Excel (or, now, I guess, PP) on the server, they do so to create a *FILE* (".doc", ".xls", ".ppt"). Then they make a download link on a web page to that file.

Tedious, to say the least.

************

Code:
I have evaluated this components [example: AspJpeg] but none of them support drag & drop, like PP. So, I will be glad if you know someone which supports this feature.
Ummm...PowerPoint scripted from ASP does *NOT* support drag and drop! You are forgetting that when you script from ASP, it *MUST* be the SERVER-SIDE ASP code that does the "driving." And how can the server-side code possibly do things that are commanded by the browser users, in real time??? Can't happen.

So of course AspJpeg doesn't support drag-and-drop. It makes no sense to even attempt to do so.

*************

If you want something that is interactive *ON THE CLIENT*, then you will have to create code that *RUNS* on the client.

I think this means you will *NOT* be using a browser.

You will need to create a ".exe" program that your users download to their machines and then use. NOTE: So why not just let them use PowerPoint on their own machines?

If you really want/need to do this in the browser, you really only have two or three choices:
(1) JavaScript. JS code *can* drag and drop images or text. JS code *can* resize images (at least the appearances of the images). And so on.

(2) Flash. Not really any easier to use for these purposes than JavaScript. Or at least not much easier.

(3) SilverLight. Microsoft's answer to Flash. I have zero experience with it and no idea if it is better for this than Flash.

I think, ultimately, you will have to use either JavaScript or just tell your people to use PowerPoint on their own machines.
The Following User Says Thank You to Old Pedant For This Useful Post:
scripter.loco (April 28th, 2009)
 
Old April 28th, 2009, 06:09 PM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Old Pedant,
I think the best way to achieve this is to use Javascript. In fact, I was checking out how gmail supports the Presentation Documents and it looks quite similar which I need to develop.

I bet gmail supports this capability using AJAX.

However, I have a new challenge, how to handle AJAX in ASP Classic. (maybe a new thread).

Anyway, thanks a lot for shed light on this.

Scripter.loco
 
Old April 29th, 2009, 12:39 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

AJAX has nothing (directly) to do with server side language or code.

AJAX runs *in the browser*, only.

Oh, true, it makes requests of servers, but those requests are NO DIFFERENT than any other web page requests. What the AJAX code wants the web pages to return may be very specialized, but if you control BOTH ENDS of the answer, then you can easily simply have your AJAX code and the web server (yes, including ASP) code "agree" on what the one wants and the other delivers.

Using ASP to serve up AJAX content is no harder than using any other server technology to do so. Granted, if you want to serve up XML content for AJAX then ASP isn't the most convenient server-side technology to use, *BUT* you do not *HAVE* to use XML! You can just send plain text--or plain binary--if your AJAX code and the web server simply agree on what is being sent and returned.

Mind you, I'm not clear that AJAX actually has much place in what you want to do, as described in your first message. Everything you asked for except maybe rotate can be done 100% in client-side JavaScript. And if you reallly need to rotate images, I don't think AJAX is much help; I think, instead, you would just ask for an <IMG> that is created (e.g., by AspJpeg) on the server.
 
Old May 2nd, 2009, 08:39 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

These days I am working on a similar application. If you are working with ASP application than you first need to check if your hosting server has some image editing component installed.

Instead of opening application in power point, how about using a good online HTML editor which also has the drawing optoins..
 
Old May 3rd, 2009, 01:44 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So do you know of a "good online HTML editor which also has the drawing options"??

I'd love to try one out!
 
Old May 3rd, 2009, 03:33 PM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by itHighway View Post
These days I am working on a similar application. If you are working with ASP application than you first need to check if your hosting server has some image editing component installed.

Instead of opening application in power point, how about using a good online HTML editor which also has the drawing optoins..
Hi itHighway,
which component are you talking about.

I've been checking some of them out but none handle drag & drop, like PP.

Thanks,





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating ASPX on the fly sandeepbhutani304 ASP.NET 2.0 Basics 0 September 16th, 2008 12:49 AM
Controls on the fly language rulllesss XML 0 June 9th, 2008 09:16 AM
Change title on the fly? darkhalf Javascript 1 March 12th, 2006 04:44 PM
Excel on the fly tjse7en Classic ASP Basics 1 September 23rd, 2005 06:18 AM
creating controls on the fly mtrtxs Access 9 September 10th, 2004 04:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.