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

Conversion excel to PDF giving exception Index out of bounds.


during the conversion of a excel file to pdf, it was throw the exception "The index was out of bounds [...] [ Name of parameter: Index ]".

The excel is a model that uses tags to fill through code, then we convert the result to pdf. Attached I will the result that should be converted to pdf.

Attachment: result_3c19812a.zip

3 Replies

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team January 22, 2020 07:51 AM

Hi Cláudio, 

Greetings from Syncfusion. 

We are able to reproduce the reported issue and validating it currently. We will share the validation details on 24th January 2020. 


AV Abirami Varadharajan Syncfusion Team January 26, 2020 08:35 PM

Hi Claudio, 

Thank you for your patience. 

We confirmed the issue with “Exception throws while ExcelToPDF conversion on creating PivotTable only with Row Fields” is a defect and logged a defect report for the same. The patch for this issue is estimated to be available on 7th February 2020. You can track the status of defect report through following feedback link. 

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team February 7, 2020 07:02 AM

Hi Cláudio, 

Thanks for your patience. 

We have fixed the issue Exception throws while ExcelToPDF conversion on creating PivotTable only with Row Fields and generated patch in the version v17.4.0.39.  

We suggest you to use the patch with following code snippet. 

Code Snippet: 

            //Instantiate ExcelEngine 
            using (ExcelEngine excelEngine = new ExcelEngine()) 
                //Initialize IApplication 
                IApplication application = excelEngine.Excel; 
                //Set the default application version 
                application.DefaultVersion = ExcelVersion.Excel2013; 
                //Load the existing Excel docuemnt into IWorkbook 
                IWorkbook workbook = application.Workbooks.Open(Server.MapPath("App_Data/result.xlsx"), ExcelOpenType.Automatic); 
                //Initialize ExcelToPdfConverter 
                ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook); 
                //Initialize ExcelToPdfConverterSettings and disable the gridlines 
                ExcelToPdfConverterSettings converterSettings = new ExcelToPdfConverterSettings(); 
                converterSettings.DisplayGridLines = GridLinesDisplayStyle.Invisible; 
                //Initialize PDF document 
                PdfDocument pdfDocument = new PdfDocument(); 
                //Convert Excel document into PDF document 
                pdfDocument = converter.Convert(converterSettings); 
                //Open the document in browser after saving it 
                pdfDocument.Save("Output.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save); 

The patch with fix to resolve the reported issue can be downloaded from the following link. 

Recommended approach - exe will perform automatic configuration       
Please find the patch setup from below location:       
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment       
Please find the patch assemblies alone from below location:       

Assembly Version: 

Installation Directions :        
This patch should replace the files “Syncfusion.XlsIO.Base.dll” under the following folder.       
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6       
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\\precompiledassemblies\\4.6    
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.       
Note :        
You can change how you receive bug fixes by navigating to the following link and updating your preferences.        
Disclaimer :   
Please note that we have created this patch for version specifically to resolve the issues reported in forum 150841.      
If you have received other patches for the same version for other products, please apply all patches in the order received.       
This fix will be included in our release version 18.1 which will be rolled out by end of March 2020.  


Live Chat Icon For mobile
Up arrow icon