Hi,
we have a wmf-file in the excel header and converting it to pdf, we receive a black frame aroound the image. If we use a png-file, it works fine. Could you please check?
The code, we use, is:
MemoryStream ms = new MemoryStream();
Workbook workbook = new Workbook(sInFile);
workbook.RemoveMacro();
Aspose.Cells.Rendering.ImageOrPrintOptions saveOptionsCell = new Aspose.Cells.Rendering.ImageOrPrintOptions();
saveOptionsCell.SaveFormat = Aspose.Cells.SaveFormat.Pdf;
workbook.Save(sOutFile, Aspose.Cells.SaveFormat.Pdf);
Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
workbook.Worksheets.Clear();
In the attachement
Bug_1.* shows the problem with .wmf-File, Bug_1_1.* shows the correct result with .png-fle.
Kind regards,
Oliver
Hi Oliver,
Thank you for providing your sample spreadsheets for our review. We have evaluated your presented issue on our end, and we believe that the said problem is due to the WMF file it self. If you convert the Bug_1.xls file with MS Excel manually, the image in the header will appear with a frame. Therefore the issue is not due to Aspose.Cells for .NET API. Moreover, I have performed some tests by inserting other WMF files in the spreadsheet header, in all cases I am not getting the outline frame in the resultant PDF. Please check the attached archive for my input, output and sample WMF files.
Sample code to convert XLS to PDF is as follow,
C#
var book = new Workbook(myDir + “bug_1.xls”);
book.Save(myDir + “output.pdf”, SaveFormat.Pdf);
Hi,
Thanks for the template files.
After an initial test, I observed the issue as you mentioned by converting your template file(s) e.g “BUG_1.xls” to PDF format. There is a frame around the image in the output PDF. I have logged a ticket with an id “CELLSNET-42216” for your issue. We will look into it to figure it out soon.
PS. When I convert the file to PDF using MS Excel (2010/2007) render manually, it also shows the frame around the header image “DELUXE”. Anyways, as we logged a ticket, so we will evaluate and check if this is an issue or expected behavior or we could do something to remove that frame around the image.
Thank you.
Hi,
After further evaluation of your issue, well, since, your file “BUG_1.xls” when rendered to PDF using built-in MS Excel 2007/2010 render, it also has the frame around the image and as we do follow MS Excel standards, so, we do not think it is a issue with our product. Therefore, we might not fix the issue “CELLSNET-42216”.
Thanks for your understanding!
Hi Amjad,
please have alook at the 3 png-files I provide.
Aspose_Cells.png is the result of the conversion using Aspose.cells. If you zoom in, you can see the black frame around the logo.
MS_Excel.png is the result of Excel using “Save As” and .pdf. There is no frame around the logo.
In LOGO.PNG you can see the logo in two different viewers (irfanview and Paint), and they both don’t show a frame around the logo -> there is no frame in the logo-file.
Comparing Aspose_Cells.png and MS_Excel.png, Aspose does not exactly the same as Excel.
Could you please check again, and may be, you find out, where the frame comes from, and how to eliminate it.
Thank you for your support,
kind regards,
Oliver
Hi,
Well, I think you might have provided the wrong file to us as the screen shots denotes different file I think. We evaluated your file “BUG_1.xls” which you posted in one of your previous post(s). Anyways, we again did the evaluation and comparison b/w Aspose.Cells’ generated PDF Vs Excel’s generated PDF file. Please see the screen shot attached here for your reference, I could not spot any significant difference regarding black thin frame that is around the header image.
Thank you.
Hi,
we did some more tests with a .xlsx-file (before it was a.xls file) and we can see, that Aspose works like Excel. So this behavior is ok for us and this incident can be closed.
Thank you for your help and your patience.
kind regards,
Oliver
Hi Oliver,
Thank you for your confirmation.
We may now close the ticket attached to this thread. Please feel free to write back in case you have any further questions.