We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ExcelEngine bugs

  • When converted to PDF, the border line gets thicker, in pdf it gets 1px thick, while it should be around 0.75px thick, pdf should look same as xlsx file.
  • If Excel is not activated, the font gets reset. Eg, write 2 lines in a cell, change its font and make first line bold. Now when you apply marker to it. The fonts will be reset back to Arial or something if excel is not activated. OS : Windows 10
  • The insert:copystyles, doesn't copy the merged cells.


        void TestExcelEngine()
        {
            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                IWorkbook workbook = excelEngine.Excel.Workbooks.Open(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "Template.xlsx"));
                IWorksheet worksheet = workbook.Worksheets[0];


                ITemplateMarkersProcessor marker = workbook.CreateTemplateMarkersProcessor();
                List<Class> list = new List<Class>();
                for (int a = 0; a < 10; a++)
                {
                    list.Add(Class.TestMarkers(a));
                }
                marker.AddVariable("Class", list);
                marker.ApplyMarkers();






                string targetPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "Applied.xlsx");
                workbook.Version = ExcelVersion.Excel2007;
                workbook.SaveAs(targetPath);

                ExcelToPdfConverter converter = new ExcelToPdfConverter(worksheet);
                PdfDocument pdfDocument = converter.Convert();
                MemoryStream stream = new MemoryStream();
                pdfDocument.Save(System.IO.Path.ChangeExtension(targetPath, ".pdf"));
            }
        }

Attachment: Template_da57c749.zip

1 Reply

AV Abirami Varadharajan Syncfusion Team September 19, 2019 04:42 PM UTC

Hi John, 
 
Please find the details for your queries below. 
 
Queries 
Details 
When converted to PDF, the border line gets thicker, in pdf it gets 1px thick, while it should be around 0.75px thick, pdf should look same as xlsx file. 
While viewing the converted PDF document, you may find the border lines are little thick when compared to Excel file. This is due to variation between Excel and PDF viewer. We have rendered the border line as per MS Excel behaviour. So, this is not an issue. 
If Excel is not activated, the font gets reset. Eg, write 2 lines in a cell, change its font and make first line bold. Now when you apply marker to it. The fonts will be reset back to Arial or something if excel is not activated. OS : Windows 10 
We are not clear with the issue you are mentioning, we request you to share more details about the issue you are facing along with the issue reproducing sample which will be helpful for us to validate further from our side. 
The insert:copystyles, doesn't copy the merged cells. 
You need to include copymerges to marker variable in order to copy the merged cells while applying template marker. Please refer to below article to know more about this. 
 
 

Regards, 
Abirami 


Loader.
Live Chat Icon For mobile
Up arrow icon