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
close icon

export excel to pdf without save

Hi,
 
I need help to export the excel file into pdf wihout save.
 
I tried the sample code,
 

Dim converter As New ExcelToPdfConverter(strAppPathUpdate)
Dim pdfDoc As New PdfDocument
Dim settings As New ExcelToPdfConverterSettings()
settings.LayoutOptions = LayoutOptions.FitSheetOnOnePage
settings.TemplateDocument = pdfDoc
            settings.DisplayGridLines = GridLinesDisplayStyle.Invisible
pdfDoc = converter.Convert(settings)
pdfDoc.Save(path)

instead of save, is any code to show the pdf in the viewer.

because, if the user clicks the generate button second time (wihout closing the first time generated pdf file),

system throws exception.

Thanks & Regards

Abraham. P

 


9 Replies

KB Kanimozhi Bharathi Syncfusion Team October 21, 2016 12:44 PM UTC

Hi Abraham, 

We have prepared a sample based on your requirement of viewing the exported PDF files. Please find the sample link for your reference, 


Note: The exception occurs because the saved PDF file is still in open mode. 

Regards 
Kanimozhi B 



AB abraham October 26, 2016 04:18 AM UTC

Hi,
 
Thanks for your reply,
 
I already tried with the same code, which you have given in the link below. same code I have used in my application.
my request is, if the user open the converted pdf file and not closed, agin if the user click the export button,
how to avoid this exception.
 
Is there any alternate method to export pdf wihout save??
 
In my previous query too, I have mentioned the same, that I have got this exception and is there any menthod.
 
Thanks & Regards,
Abraham. P


KB Kanimozhi Bharathi Syncfusion Team October 27, 2016 12:16 PM UTC

Hi Abraham, 
 
We have checked with your issue and you can overcome this issue by generating the PDF through PdfViewer by saving the pdf as stream and viewing it. We have prepared the sample based on your requirement . Please find the link below 
 
 
Regards 
Kanimozhi B 



AB abraham October 31, 2016 10:51 AM UTC

Hi,
 
Thank you for your response. I checked your sample application, but I was not able to run, because I'm using VS2010 and .net framework 3.5, and the Syncfusion version 11.104.0.21(Syncfusion.XlsIO.Wpf).
 
I tried with the syncfusion dashbord (essential studio 2013 volume1. )
WPF - Import and Export (Excel to PDF)

This sample illustrates Essential XlsIO's and Essential PDF's support for conversion from MS Excel document to PDF document.

I'm using the same code in my application, instead of saving the pdf file need to change the logic to generating the PDF through PdfViewer by saving the pdf as stream and viewing.

Is there any sample which supports VS2010 and 3.5 .net framework

Thanks,

Abraham. P

 

 

 

 
 
 
 


KB Kanimozhi Bharathi Syncfusion Team November 2, 2016 05:34 AM UTC

  
Hi Abraham,  
  
We have prepared the sample based on your requirement in  VS2010 and 3.5 .net framework. Please find the link below  
  
 
Also we request you to upgrade with our Essential Studio Volume 3 SP 1, 2016 (Version 14.3.0.52)  which has been rolled out and is available for download under the following link. 
 
                                              
Regards  
Kanimozhi B  



AB abraham November 2, 2016 09:37 AM UTC

Hi,
 
Thanks for your response, I tried with your sample code, but it throws an exception
 
Error 1 'Syncfusion.Windows.PdfViewer.PdfViewerControl' does not contain a definition for 'Print' and no extension method 'Print' accepting a first argument of type 'Syncfusion.Windows.PdfViewer.PdfViewerControl' could be found (are you missing a using directive or an assembly reference?)
I'm using VS2010 with .NETFramework v4.0
 
I have change the application to target framework v4.0, but the application is not build.
 
Thanks & Regards,
Abraham. P
 


KB Kanimozhi Bharathi Syncfusion Team November 2, 2016 12:13 PM UTC

Hi Abraham, 

Can you please upgrade from your current version(11.1) to higher version(14.3) for using the “DirectPrint” feature in PdfViewerControl. 
 
Regards 
Kanimozhi B


AB abraham November 4, 2016 04:17 AM UTC

Hi,
 
Thanks for the reply, please confirm whether pdfviewer control will work our installed version or not.
There is one sample in the Essential Studio 2013 Vol 1 WPF (Syncfusion Essential Pdf Viewer) application.
 
Thanks & Regards,
Abraham. P


TL Thirumurugan Loganathan Syncfusion Team November 7, 2016 12:38 PM UTC

Hi Abraham, 

I have checked your query and found that PDFViewerControl does not have “DirectPrint” support in the your Syncfusion version (11.1). However the document can be printed using the PrintDocument API of the PdfViewerControl with DocumentPaginator. Please find the below given sample for more clarification. 

 
Regards, 
Thirumurugan 


Loader.
Live Chat Icon For mobile
Up arrow icon