Re: Back to .NET integration - Enumeration issue

2010-11-08 Thread Leigh

>> The resulting image appears to be a valid JPG image. I say appears 
>> because the CFIMAGE tag falls over if I try to read it back into CF. 

Yes, as you guessed you have to convert the bitmap to jpeg format first.

>> I'd still like to find out why the other approach with .NET 
>> classes didn't work. It's so confusing... 
>>  
>>  
>>  

Assuming "img" actually is a Bitmap, then Save(filePath, imageFormat) should 
just work fine. (It did for me.) So I am not sure what the problem was ..

-Leigh


  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338968
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-08 Thread Stefan Richter

I've now worked around this to some degree by saving the initial image with a 
.png extension and then re-saving it using cfimage. This seems to work. 

I'd still like to find out why the other approach with .NET classes didn't 
work. It's so confusing...

Cheers 

Stefan





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338944
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-08 Thread Stefan Richter

I need to warm this thread up again - I am s close...

As explained before I was able to use the .NET Bitmap's save method to save an 
image:







The resulting image appears to be a valid JPG image. I say appears because the 
CFIMAGE tag falls over if I try to read it back into CF. 


Error:
ColdFusion was unable to create an image from the specified source file.
Ensure that the file is a valid image file. 


So I thought ok, let's try and pass an Imageformat to the Bitmap's save method. 
http://msdn.microsoft.com/en-us/library/aa903826%28v=VS.71%29.aspx

I can do this:



But if I then try to pass that to the Save method it errors again:
The Save method was not found.
Either there are no methods with the specified method name and argument types 
or the Save method is overloaded with argument types that ColdFusion cannot 
decipher reliably. ColdFusion found 0 methods that match the provided arguments.


I'm banging my head now. I also tried imageformat.Jpeg
but no dice.
Element JPEG is undefined in IMAGEFORMAT. 


Any tips appreciated.

Stefan




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338937
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Leigh

> the newest version of "DLL Hell".

Darn, and here I thought we had graduated to purgatory ..

-Leigh


  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338859
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Dave Watts

> No. I needed to supply a path for System.Diagnostics too. But my test machine 
> has multiple versions installed. So maybe that
> has something to do with it.

That's almost certainly the problem - you're in the newest version of
"DLL Hell".

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338858
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Leigh

No. I needed to supply a path for System.Diagnostics too. But my test machine 
has multiple versions installed. So maybe that has something to do with it.

-Leigh


  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338857
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Dave Watts

> Do you know any common reasons why you might have to specify an assembly in 
> this case? Because I can see System.Drawing
> in the GAC. But was unable to reference any of the classes unless I supplied 
> a path.  So I was curious as to what might cause
> that.

Not really. Are you able to reference other System classes without a
path? System.Diagnostics is a good test class for this.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338854
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Leigh

> But in general, if you have a non-abstract class in
> System.*, you
> should be able to instantiate it without specifying an
> assembly path
> as it'll be in the Global Assembly Cache.

Dave,

Do you know any common reasons why you might have to specify an assembly in 
this case? Because I can see System.Drawing in the GAC. But was unable to 
reference any of the classes unless I supplied a path.  So I was curious as to 
what might cause that.

-Leigh


  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338851
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Leigh

Well as Dave said, System.Drawing.Bitmap descends from System.Drawing.Image. So 
it should have access to everything in the Image class. Since you already have 
a reference to a Bitmap, try using it instead.

> Do you know how to instantiate System ddls? 
> class="System.Drawing.Image"

Well technically you do not instantiate an abstract class. That said, creating 
a reference to System.Drawing.Image works fine for me.

-Leigh



  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338850
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Dave Watts

> Do you know how to instantiate System ddls? I keep getting errors when I try 
> either
>
>  assembly="C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Drawing.dll">
>
> or
>
> 
>
> "Class System.Drawing.Image not found in the specified assembly list."

You can't instantiate an abstract class. Think of Image as being
somewhat analogous to an interface in AS3.

But in general, if you have a non-abstract class in System.*, you
should be able to instantiate it without specifying an assembly path
as it'll be in the Global Assembly Cache.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338849
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Stefan Richter

BTW you were right, I can call Save() on Bitmap :-)

Thanks! 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338848
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Stefan Richter

Thanks again.
Do you know how to instantiate System ddls? I keep getting errors when I try 
either



or




"Class System.Drawing.Image not found in the specified assembly list."


Cheers 

Stefan





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338847
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Dave Watts

> When I dump the object of type System.Drawing.Bitmap it does not show me a 
> Save method.

Nevertheless, it should be in there. Image is an abstract class from
which Bitmap is descended. I suspect that CFDUMP doesn't show you the
methods of this abstract parent.

> I'm not a backend programmer and C# is pretty alien to me. I understand this 
> would all be much simpler in pure C# I guess but I
> feel I'm close now, all that's left is to somehow save the C# Bitmap to an 
> image...

C# is actually a lot like AS3. And yeah, it's kind of hard to pick out
pieces of C# to execute from CF, which is why I generally like to
write a C# wrapper that does all of the intermediate steps I need to
do, then call that wrapper from CF.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338846
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Stefan Richter

Thanks Dave but how do I do this in CF?
When I dump the object of type System.Drawing.Bitmap it does not show me a Save 
method. 

I'm not a backend programmer and C# is pretty alien to me. I understand this 
would all be much simpler in pure C# I guess but I feel I'm close now, all 
that's left is to somehow save the C# Bitmap to an image...

Any pointers much appreciated.

Stefan



Class Name  System.Drawing.Bitmap
Methods 
Method  Return Type
Clone(System.Drawing.RectangleF, System.Drawing.Imaging.PixelFormat)
System.Drawing.Bitmap
Clone(System.Drawing.Rectangle, System.Drawing.Imaging.PixelFormat) 
System.Drawing.Bitmap
FromHicon(System.IntPtr)System.Drawing.Bitmap
FromResource(System.IntPtr, java.lang.String)   System.Drawing.Bitmap
GetHbitmap(System.Drawing.Color)System.IntPtr
GetHbitmap()System.IntPtr
GetHicon()  System.IntPtr
GetPixel(int, int)  System.Drawing.Color
LockBits(System.Drawing.Rectangle, System.Drawing.Imaging.ImageLockMode, 
System.Drawing.Imaging.PixelFormat, System.Drawing.Imaging.BitmapData) 
System.Drawing.Imaging.BitmapData
LockBits(System.Drawing.Rectangle, System.Drawing.Imaging.ImageLockMode, 
System.Drawing.Imaging.PixelFormat)System.Drawing.Imaging.BitmapData
MakeTransparent()   void
MakeTransparent(System.Drawing.Color)   void
SetPixel(int, int, System.Drawing.Color)void
SetResolution(float, float) void
UnlockBits(System.Drawing.Imaging.BitmapData)   void



> 
> http://msdn.microsoft.com/en-us/library/system.drawing.image.save%28VS.
> 80%29.aspx



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Dave Watts

> Many thanks. I now only need to figure out how to convert/cast a .NET 
> instance of System.Drawing.Bitmap to something I can
> save in CF as a JPG or similar.

http://msdn.microsoft.com/en-us/library/system.drawing.image.save%28VS.80%29.aspx

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338843
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Stefan Richter

> So try grabbing a reference to the Aspose.Slides.Export.SaveFormat. 
> Then use: YourReference.Pdf
> 

Awesome, that worked!

Many thanks. I now only need to figure out how to convert/cast a .NET instance 
of System.Drawing.Bitmap to something I can save in CF as a JPG or similar. 

Cheers 

Stefan







~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338842
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Back to .NET integration - Enumeration issue

2010-11-05 Thread Leigh

If the documentation can be believed:

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=dotNet_04.html
"...enumerator elements can be accessed directly by using the format 
Enumerator_variable.enumerator, as in MyColor.Red"

So try grabbing a reference to the Aspose.Slides.Export.SaveFormat. Then use: 
YourReference.Pdf

-Leigh




  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Back to .NET integration - Enumeration issue

2010-11-05 Thread Stefan Richter

Hi all,
I'm back working with the Aspose .NET ddls and have a question.

First I do this:



Now in order to save this presentation in another format the docs state that I 
need to do call the Save method of the Presentation class. It accepts two 
parameters, a string describing the file location, the second is constant 
described by this class:

C#
public enum SaveFormat

Members
Member Name Description Value
Ppt Save presentation in PPT format.0
Pps Save presentation in PPS format.0
Pdf Save presentation in PDF format.1
Xps Save presentation in XPS format.2
PptxSave presentation in PPTX format.   3
PpsxSave presentation in PPSX format.   4
TiffSave presentation as multi-page TIFF image. 5

Question:
How do I use this in CF? I've tried the following:


and



but both throw errors:
"The Save method was not found.
Either there are no methods with the specified method name and argument types 
or the Save method is overloaded with argument types that ColdFusion cannot 
decipher reliably. ColdFusion found 0 methods that match the provided 
arguments."

If I dump an instance of the SaveFormat class I see this:


Field Value
Aspose.Slides.Export.SaveFormat Pdf Aspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat Pps Aspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat PpsxAspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat Ppt Aspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat PptxAspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat TiffAspose.Slides.Export.SaveFormat
Aspose.Slides.Export.SaveFormat Xps Aspose.Slides.Export.SaveFormat 


Any tips appreciated.


Stefan









~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338840
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm