@kumar.penigalapati,
Thank you for sharing the feedback. We are analyzing it and will share our feedback soon.
@kumar.penigalapati,
Please run the following code in your web application:
HtmlLoadOptions options = new HtmlLoadOptions();
options.StreamProvider = new StreamProvider47584(proxyurl);
Workbook wb = new Workbook(filePath + "HtmlPage2.html", options);
wb.Save(filePath + "Page_out.xlsx");
class StreamProvider47584 : IStreamProvider
{
private string proxyUrl;
public StreamProvider47584(string url)
{
this.proxyUrl = url;
}
void IStreamProvider.InitStream(StreamProviderOptions options)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)0x300;
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)0xC00;
WebProxy proxy = new WebProxy(proxyUrl);
WebRequest request = WebRequest.Create(options.DefaultPath);
request.Proxy = proxy;
WebResponse response = request.GetResponse();
Stream srcStream = response.GetResponseStream();
byte[] imageBytes = CopyStreamToByteArray(srcStream);
options.Stream = new MemoryStream(imageBytes);
}
void IStreamProvider.CloseStream(StreamProviderOptions options)
{
if (options != null && options.Stream != null)
{
options.Stream.Close();
}
}
}
internal static byte[] CopyStreamToByteArray(Stream stream)
{
int length = (int)stream.Length;
byte[] data = null;
if (length == 0)
{
if (stream.CanSeek)
{
stream.Position = 0;
}
data = new byte[4096];
MemoryStream dest = new MemoryStream();
while (true)
{
int size = stream.Read(data, 0, data.Length);
if (size > 0)
{
dest.Write(data, 0, size);
}
else
{
break;
}
}
return dest.ToArray();
}
else
{
data = new byte[length];
if (stream.CanSeek)
{
stream.Position = 0;
}
stream.Read(data, 0, length);
}
return data;
}
Can you try it and let us know your feedback.
Moreover, If you still could not get the image, please check the imageBytes of every image stream and provide us more details on it, we will check it soon.
Hi Amjad Sahi,
with the example you provided i was getting an error at the line
int length = (int)stream.Length;
but i have modified it little but and after that it works fine, i am able to see the images fine.
but the only issue is they are not aligned correctly, they are on top of each other.
please see the attached code.WebApplication7.zip (8.3 MB)
Hi Ahsan Iqbal,
Any update ? we have a release approaching in a week, we would like to get this thing working as soon as possible.
Appreciate your efforts if you can quickly resolve this.
Thank you.
@kumar.penigalapati,
We are gathering information about this issue and will share our feedback as soon as available for sharing.
ok Thank you Ahsan Iqbal
@kumar.penigalapati,
We have fixed the image position issue, please download Aspose.Cells for .Net 20.11.1 and let us know your feedback.
Aspose.Cells20.11.1 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.11.1 For .Net4.0.Zip (5.4 MB)
Hi Ahsan Iqbal,
The fix seems to be working fine, but we are still seeing the images being over lapping the text.
please see the attachments.
Thanks.
can you please Create a Nuget package with what you have right now ? so we can move forward with our release, and may be fix those issues later ?
Thank you.
@kumar.penigalapati,
It seems that you forgot to attach the files. Please share your attachments for our reference.
@kumar.penigalapati,
You may share your latest test application along with template files (if any) as well which is updated according to all the above suggestions for our final review and reproducing this issue here.
Regarding the NuGet package, this hot fix will be available through NuGet package manager after three weeks time when next release will be published.
@kumar.penigalapati,
Thank you for the sample project. We have observed the issue while using it with the latest hot fix.
@kumar.penigalapati,
We have created a new ticket “CELLSNET-47729” for images over lapping the text during html to excel conversion. Once we will have some news for you, we will update you in this topic.
Thanks Ahsan Iqbal.
Hi Ahsan Iqbal
There is one more issue we are facing trying to convert html tp excel.
please see the attached html file and same source code which we used to export like other files attached in previous examples.
HtmlPage5.zip (8.1 KB)
Error
Object reference not set to an instance of an object.
Stack Trace
at .(Int32 )
at .(Cell )
at .(Cell )
at .(Cell )
at . ()
at . ()
at .(String , ArrayList )
at .()
at .()
at .(Stream )
at .(String , Stream , LoadOptions )
at Aspose.Cells.Workbook.(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file, LoadOptions loadOptions)
at WebApplication7.Controllers.HomeController.Index() in C:\Users\akpenig\source\repos\WebApplication7\Controllers\HomeController.cs:line 25