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.
Unfortunately, activation email could not send to your email. Please try again.

export excel to pdf without save

Thread ID:

Created:

Updated:

Platform:

Replies:

126996 Oct 20,2016 06:49 AM Nov 7,2016 07:38 AM WPF 9
loading
Tags: SpreadsheetControl(Classic)
abraham
Asked On October 20, 2016 06:49 AM

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

 


Kanimozhi Bharathi [Syncfusion]
Replied On October 21, 2016 08:44 AM

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 


abraham
Replied On October 26, 2016 12:18 AM

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

Kanimozhi Bharathi [Syncfusion]
Replied On October 27, 2016 08:16 AM

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 


abraham
Replied On October 31, 2016 06:51 AM

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

 

 

 

 
 
 
 

Kanimozhi Bharathi [Syncfusion]
Replied On November 2, 2016 01:34 AM

  
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  


abraham
Replied On November 2, 2016 05:37 AM

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
 

Kanimozhi Bharathi [Syncfusion]
Replied On November 2, 2016 08:13 AM

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

abraham
Replied On November 4, 2016 12:17 AM

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

Thirumurugan Loganathan [Syncfusion]
Replied On November 7, 2016 07:38 AM

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 


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.

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.

;