This is a migrated thread and some comments may be shown as answers.

ExportToPdf not working

7 Answers 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Fit2Page asked on 22 May 2012, 02:25 PM
Hi,

I am trying to build the ExportToPdf functionality as in http://demos.telerik.com/aspnet-ajax/editor/examples/pdfexport/defaultvb.aspx

On pressing the button there is only a postback of the page, nothing happens further...no pdf export.

Suggestions?

Regards,
Marc

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 May 2012, 03:31 PM
Hi,

For your convenience I have prepared a sample demo and a video http://screencast.com/t/UYqEtA6o, which shows how the export to pdf feature works.

Regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 24 May 2012, 10:45 AM
Hi Rumen,

I know that this is working the way you pointed out, thank you.

The problem probably is that the editor is opened in a usercontrol with

Dim userControl As Control = Page.LoadControl(userControlName)

When I load the editor this way the ExportToPdf() function is not triggered?

BR,
Marc
0
Rumen
Telerik team
answered on 25 May 2012, 01:52 PM
Hi,

Do you export the content with Ajax? RadEditor's Export toPDF functionality cannot be ajaxified. This is because the Form element is modified during the procedure. In order to use ExportToPdf you need to trigger full postback. To achieve this you need to force Button1 to perform postback. You can find a detailed explanation and a solution in the following help article:
Force controls in ajaxified container to perform PostBack.

If your scenario is other, open a support ticket and provide a simple working project that demonstrates the problem.

Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 25 May 2012, 02:03 PM
That is a very clear answer Rumen, thank you.

Other question: Is it possible to skip the opening of the PDF in new or same window?
In my scenario I only want to save the editor's content in a server side PDF file.

I have already build the save functionality succesfully but it keeps me showing the PDF itself or the PDF dialogue.

Marc
0
Rumen
Telerik team
answered on 25 May 2012, 02:14 PM
Hello,

You can find attached here an example demonstrating how to silently export the editor's content as PDF on the server using the new OnExportContent event property of RadEditor.

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 29 May 2012, 09:05 AM
Thanks Rumen. That is the setup I am using.
How to proceed if the Radeditor1.ExportToPdf() is part of larger subroutine, in my case the saving of a database record?

It is no option to exit the OnExportContent Sub with a response.redirect, as it is part of a larger set of code.

Marc
0
Rumen
Telerik team
answered on 30 May 2012, 04:01 PM
Hi,

The only possible way to interrupt the ExportContent event is to invoke Response.Redirect() - AJAX call is not possible because ExportToPdf modifies the form of the returned value to be displayed (opened) as a PDF document.

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Rumen
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or