ExportToPdf not working

8 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 22 May 2012 Link to this post

    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

  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 22 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 24 May 2012 Link to this post

    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
  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 25 May 2012 Link to this post

    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.
  6. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 25 May 2012 Link to this post

    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
  7. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 25 May 2012 Link to this post

    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.
  8. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 29 May 2012 Link to this post

    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
  9. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 30 May 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017