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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

There is different in export pdf using syncfusion and export pdf using excel office

Thread ID:

Created:

Updated:

Platform:

Replies:

148410 Oct 18,2019 06:34 AM UTC Dec 9,2019 12:51 PM UTC ASP.NET Core - EJ 2 15
loading
Tags: XlsIO
Duc Tran
Asked On October 18, 2019 06:34 AM UTC

As the title. Please Take a look at the file attached!
Can you help me how to fix it?

Attachment: Book1_a43bbd09.rar

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On October 21, 2019 07:25 AM UTC

Hi Duc, 

Greetings from Syncfusion. 

Microsoft Excel scale the row height and column width based on default font used in Excel document. So, we request you to share the input Excel document used at your end for PDF conversion, which will be helpful for us to investigate further and provide prompt solution at the earliest. 

Regards, 
Keerthi.

Duc Tran
Replied On October 21, 2019 09:32 AM UTC

These are 2 excel files input. Can you show me how to export them to pdf using syncfusion the same to excel office export
This is my snippet code:

private byte[] FileDownloadPDF(string fileName)
        {
            string pdfFilePath = string.Empty;
            using (ExcelEngine excelEngine = new ExcelEngine())
            {
                IApplication application = excelEngine.Excel;
                application.DefaultVersion = ExcelVersion.Excel2013;
                //Instantiating the ChartToImageConverter and assigning the ChartToImageConverter instance of XlsIO application
                application.ChartToImageConverter = new ChartToImageConverter();
                //Tuning chart image quality
                application.ChartToImageConverter.ScalingMode = ScalingMode.Best;

                IWorkbook workbook = application.Workbooks.Open(fileName, ExcelOpenType.Automatic);
                workbook.StandardFont = "MS Pゴシック";
                //Open the Excel document to Convert
                ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);

                //Initialize PDF document
                PdfDocument pdfDocument = new PdfDocument();
                //PdfFont pdnt = new PdfCjkStandardFont(PdfCjkFontFamily.HeiseiMinchoW3, 20);
                ExcelToPdfConverterSettings e2pdfCS = new ExcelToPdfConverterSettings();
                e2pdfCS.LayoutOptions = LayoutOptions.FitAllColumnsOnOnePage;
                //Convert Excel document into PDF document
                pdfDocument = converter.Convert(e2pdfCS);

                pdfFilePath = Utility.AppSetting.UploadWorkDir + Path.GetFileNameWithoutExtension(fileName) + ".pdf";
                //Save the PDF file
                pdfDocument.Save(pdfFilePath);

                pdfDocument.Close(true);
                converter.Dispose();
                workbook.Close();
                System.IO.File.Delete(fileName);
            }
            return FileDownload(pdfFilePath);
        }
Attachment: Desktop_bc2872a0.rar

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On October 22, 2019 11:35 AM UTC

Hi Duc, 

We have tried converting the Excel document you have shared us in Microsoft Excel. The exported document have 2 pages in it. You can convert this Excel document to PDF with one page only when Fit Sheet on One Page is selected. 

Please find the same in video screenshot below. 

You can achieve this same behavior in Syncfusion XlsIO by setting the LayoutOptions as FitSheetOnOnePage. Please find the code snippet below. 

Code Snippet:  

//Fit sheet on one page 
e2pdfCS.LayoutOptions = LayoutOptions.FitSheetOnOnePage; 

We have prepared simple sample using the code you have shared us and above code snippet. The sample can be downloaded from the following link. 


Kindly try this and let us know if the issue is resolved. 

Regards, 
Keerthi. 


Duc Tran
Replied On October 23, 2019 01:44 AM UTC

Thank you for your help! But I got trouble once using FitSheetOnOnePage property. 
I send you 2 excel files. In excel file there are many page breaks then all page breaks will fit on one page once you used FitSheetOnOnePage property. 
Maybe I have to split all page breaks into many sheets and using FitSheetOnOnePage property.
I think it's not a good way? So do you have another way to handle this issue
View the detail in the attached file.
Thanks!

Attachment: Book1_e2235f64.rar

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On October 23, 2019 01:31 PM UTC

Hi Duc, 

We can skip the “FitSheetOnOnePage” for worksheets having page breaks to achieve your requirement. Please find the code snippet below. 

Code snippet: 

if (worksheet.HPageBreaks.Count == 0 && worksheet.VPageBreaks.Count == 0) 
     //Fit sheet on one page 
     e2pdfCS.LayoutOptions = LayoutOptions.FitSheetOnOnePage; 

We have made changes in the sample and the modified same can be downloaded from the following link. 


Regards, 
Keerthi. 


Duc Tran
Replied On October 24, 2019 11:22 AM UTC

Hi Supporter,
I don't want to skip worksheets having page breaks. I used a trick to handle. 
I set MarginBottom property is 5.5 and The pdf output is OK.
Now, I have another issue with the pdf output.
Pdf output is lost data when I export pdf from a template excel file
View detail in the sample attached
Thanks __!

Attachment: F148410WinForms_e3338126.rar

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On October 25, 2019 11:26 AM UTC

Hi Duc, 

Thanks for the update. 

We are able to reproduce the reported issue, data lost while exporting Excel document to PDF and validating it currently. We will provide further details on 30th October 2019. 

Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On October 30, 2019 01:35 PM UTC

Hi Duc, 

We are still validating the reported issue. We will update the validation details on 1st November 2019. 

Regards, 
Keerthi. 


Duc Tran
Replied On October 31, 2019 02:31 AM UTC

Hi Keerthi!
 I am looking forward to hearing the good news from you.
Thank you!
Duc.

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On November 1, 2019 05:52 PM UTC

Hi Duc, 

We have confirmed the issue Data lost while converting Excel to PDF and logged a defect report. We will provide the patch for this issue on 15th November 2019. 

You can track the status of defect report through following link. 

Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On November 15, 2019 05:32 PM UTC

Hi Duc, 

We have fixed the issue Data lost while converting Excel to PDF. The patch with fix to resolve the 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: 17.1.0.38 
             
Installation Directions :  
This patch should replace 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\17.1.0.38\precompiledassemblies\17.1.0.38\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 17.1.0.38 specifically to resolve the issues reported in forum 148410.                         

If you have received other patches for the same version for other products, please apply all patches in the order received. 

The fix for this issue will be included in our release version 17.4 which will be rolled out by mid of December 2019. 

Regards, 
Keerthi. 


Duc Tran
Replied On November 20, 2019 10:19 AM UTC

Hi Keerthi!
Thank you for your support.
I had another issue with the pdf file exported.
I have tested 2 files excel in folder Data: Test.xlsx and Test_OK.xlsx
The Test.xlsx file is generated by syncfusion
The Test_OK.xlsx is generated by Office 2016
While I exported 2 files to pdf using syncfusion then:
Test.pdf is exported from Test.xlsx is lost data.
Test_OK.pdf is exported from Test_OK.xlsx is OK.
I created a sample using ASP.Net MVC 5 to test(My Project using ASP.Net MVC 5 so I created a sample using it).

I hope you can fix this issue in your release version 17.4
Thanks!

Attachment: Aspnet_PDF17246_20191120_31276c60.zip

Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On November 21, 2019 12:27 PM UTC

Hi Duc, 

Thanks for the update. 

The issue reported with the Excel files shared on 20th November 2019 is with respect to formula calculation and is different from the issue reported in Excel files shared on 24th October 2019. We have forwarded this to development team for validation. We will share the validation details on 25th November 2019. 

Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On November 25, 2019 11:31 AM UTC

Hi Duc, 
 
Thanks for your patience. 
 
We have confirmed the issue SUMIFS formula return incorrect result when the criteria is number and logged a defect report. We will provide the patch for this issue on 9th December 2019. You can track the status of defect report through following link. 
 
 
Regards, 
Keerthi. 


Konduru Keerthi Konduru Ravichandra Raju [Syncfusion]
Replied On December 9, 2019 12:51 PM UTC

Hi Duc,  

We have fixed the issue SUMIFS formula return incorrect result when the criteria is number and generated patch in the version v17.1.0.38. The patch 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: 17.1.0.38 

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\17.1.0.38\precompiledassemblies\17.1.0.38\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 17.1.0.38 specifically to resolve the issues reported in forum 148410.      
              
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 17.4-SP1 which will be rolled out by end of January 2020.  

Regards,     
Keerthi. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon