Due to a customer requirement to be able to scan in 8bpp with any kind of scanner I am using your software to get a multipage PDF with 24bpp images on it. Then I use a selfmade ActiveX to convert all images to 8bpp.
There is nothing wrong with my ActiveX, I can even save to disk the resultant memory stream and it is OK. But when I send the resultant memory stream to the server using AddFileField I get "Class doesn't support Automation".
What should I do?
I'm starting to think you are receiving a somehow modified System.IO.MemoryStream object. Is that correct?
Thank you
Problem with custom MemoryStream and AddFileField
Moderator: Alex
-
- Posts: 2
- Joined: Fri Oct 21, 2011 6:16 am
Re: Problem with custom MemoryStream and AddFileField
Hello,
Best regards, Alexander
No, SDK returns "not modified" System.IO.MemoryStream object.I'm starting to think you are receiving a somehow modified System.IO.MemoryStream object. Is that correct?
How do you use VintaSoftTwain.NET SDK? SDK is a .NET component, not ActiveX control.... I get "Class doesn't support Automation".
Best regards, Alexander
-
- Posts: 2
- Joined: Fri Oct 21, 2011 6:16 am
Re: Problem with custom MemoryStream and AddFileField
Dear Alexander,
First I create an object:
<object id="enviohttp" width="1" height="1" classid="<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>/Vintasoft.Twain.dll#Vintasoft.Http.HttpUpload" codebase="<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>/Vintasoft.Twain.dll#version=7,1,7,3">
Then I have a javascript function to send the scanned images to the server:
<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>
function EnviaraServer(imagen,n,cl,tk) {
if (enviohttp.ProxyPort == null) {
alert("blah blah");
return;
}
try {
enviohttp.Url = "<% Response.Write(Session["url"]); %>";
enviohttp.CookieHeader = document.cookie;
enviohttp.UseDefaultCredentials = true;
var obj = new ActiveXObject("EasyCloudCOM.Convertir");
imagen = obj.ToPDF8BPP(imagen);
obj.SavePDF(imagen);
alert(''til here is OK');
enviohttp.AddFileField("file",cl + ":" + tk + ":" + n + ".pdf", imagen);
alert('it never gets here');
...
If I remove my activeX it works fine, but I do not understand why.
To be sure that I do not generate a corrupt memorystream I made a new method called "SavePDF" which succesfully writes the memory stream to disk just before calling AddFileField method.
I'm a bit lost here, any help will be appreciated.
First I create an object:
<object id="enviohttp" width="1" height="1" classid="<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>/Vintasoft.Twain.dll#Vintasoft.Http.HttpUpload" codebase="<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>/Vintasoft.Twain.dll#version=7,1,7,3">
Then I have a javascript function to send the scanned images to the server:
<% Response.Write(Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/"))); %>
function EnviaraServer(imagen,n,cl,tk) {
if (enviohttp.ProxyPort == null) {
alert("blah blah");
return;
}
try {
enviohttp.Url = "<% Response.Write(Session["url"]); %>";
enviohttp.CookieHeader = document.cookie;
enviohttp.UseDefaultCredentials = true;
var obj = new ActiveXObject("EasyCloudCOM.Convertir");
imagen = obj.ToPDF8BPP(imagen);
obj.SavePDF(imagen);
alert(''til here is OK');
enviohttp.AddFileField("file",cl + ":" + tk + ":" + n + ".pdf", imagen);
alert('it never gets here');
...
If I remove my activeX it works fine, but I do not understand why.
To be sure that I do not generate a corrupt memorystream I made a new method called "SavePDF" which succesfully writes the memory stream to disk just before calling AddFileField method.
I'm a bit lost here, any help will be appreciated.
Re: Problem with custom MemoryStream and AddFileField
Hello,
Could you send us a working application which demonstrates your problem?
Best regards, Alexander
Could you send us a working application which demonstrates your problem?
Best regards, Alexander