Getting Error while merging Empty Excel Documents

Hello,

I am using Aspose PDF Kit version 5.3.0.0 in my ASP.Net Application. I need to convert the excel or powerpoint or word type of attachments to PDF . For conversion process I am using Aspose cells to convert the excel into memory stream and then I will convert that memory stream to PDF using PDF Kit in which I have followed the documentation like this

PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.Concatenate(ArrayStreams, OutStream);


From the above code the Arraystreams represents the excel which is converted into stream and at the PDF concenate method I am getting the following error
Exception occurred during the
processing stream


I am getting the above error only on empty documents.Could you provide an solution for this.


Hi,

Please try to use the latest version (5.4.0) at your end. If it doesn’t resolve your issue then please share a small sample application, along with the input files, which can help us reproduce the same issue over here. You do not need to share the DLLs and license file; only the sample code and the related input files are required to reproduce the issue.

Moreover, I would like to share that it is very important for us to reproduce the issue using your particular scenario in order to understand and then resolve it.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

Hello Shahzad,

Thank you very much for the reply.

I have downloaded the latest version 5.4.0 and while converting the empty excel documents I am getting the error for MS-Excel 2010(.xslx) [File does not exist] and MS- Excel 2003(.xls) [Index outside the bounds of the array]. So I have attached the sample code. Could you provide the solution as soon as possible

Hi,

I have further investigated this issue in detail and noticed that the issue only occur when we use empty Excel files. If the Excel files are empty, the PDF files are not saved correctly, and that’s why the Concatenate method is unable to process those files.

However, if you enter some content in the input Excel files, this issue will not occur anymore. Nevertheless, I’m moving this thread to the Aspose.Cells forum, so that the related team would be able to look into the matter that why the empty Excel files are not saved correctly to PDF format. You’ll be updated with the results via this forum thread, the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi,

I have created a pdf from empty workbook. Please see the output.pdf. Actually, it gives me a message there is no pages inside the pdf, so it cannot be opened.

I have tested it with latest Aspose.Cells
for .NET v5.3.1.2


This issue has been logged as CELLSNET-25490.

Below is the code example. Please note, Aspose.Cells for .NET can create pdf by itself from workbooks without the need of Aspose.Pdf component.

C#


Workbook workbook = new Workbook();

workbook.Save(“f:\downloads\output.pdf”, SaveFormat.Pdf);

Hello,

sorry,we are not getting it right.we have used the latest version 5.3.1.2. dll.But we are getting the error.Our requirement is not to save it to local disk.We have merged two or more pdf streams,which are returned by the workbook.save(stream) method.Here i give the code.

memorystream outstream = new memorystream();
Workbook workbook = new Workbook();
workbook.Save(outstream, SaveFormat.Pdf);
return outstream;


//now I need to use outstream in pdfviwer.concatenate method
private static MemoryStream[] ArrayStreams;
//outstrem is added as a member of arraystreams
PdfFileEditor pdfEditor = new PdfFileEditor();
pdfEditor.AllowConcatenateExceptions = true;
pdfEditor.Concatenate(ArrayStreams, OutStream);//IN this line I am getting error

//Now i need to show it in browser
byte[] outBuf = outputStream.GetBuffer();



// specify the duration of time before a page,cached on a browser expires
Response.Expires = 0;
// Specify the property to buffer the output page
Response.Buffer = true;
// Erase any buffered HTML output
Response.ClearContent();
//Add a new HTML header and value to the response sent to the client
Response.AddHeader(“content-disposition”, “inline; filename=” + “output.pdf”);
// Specify the HTTP content type for response as Pdf
Response.ContentType = “application/pdf”;
// Write specified information of current HTTP output to Byte array
Response.BinaryWrite(outBuf);


this is our actual requirement.


Hi,

Well, once the above issue will be resolved, this code will also be fixed.

Actually, you do not get correct stream, that’s why you are getting a problem. Once, empty workbook will start saving something like a single page, it will return correct stream, so your code will be fixed.

Hi msshakeel,

I afraid whether you get our requirements exactly.“this code will also be fixed”–I don’t get your intention.I think it will be worked by your support team. Am I right? Could you provide a date when can we get this done.

Hi,

Please download Aspose.Cells for .NET v5.3.1.4. We have fixed the issue you
mentioned.

Hello Mshakeel,

Thank you very much for your support.Its working fine.



The issues you have found earlier (filed as 25490) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan