Radzen Components to pdf

Hello, Im trying to print from that uses Radzen components as pdf, but the components for somehow prevents the pdf creation. The app just restarts when I click the create pdf button and it does the same one any option I use to print the the rdazen form as pdf, but it I change it for normal html elements or use any other Blazor component library it works just fine.
Do you know why this my be happening? I need help, please!!

Hi @Wellington_Munoz,

I am afraid I don't understand what the issue is. What is PDF creation? What is the "create pdf button"? We need more information about the problem.

This is the code a have. It is some Radzen components to fill out a form.
I have a method to convert the form into pdf to export it. However when I click the Export to PDF
button, Blazor signalr connection gets broken and it just tries to reconnect again, but then when I use normal html elements to create the form or any other Blazor component library, the html form get exported to pdf with no issue.

I also tried to integrate Synfusion HTMLToPdf functionality and it also gave some error when using Radzen components.

<button class="btn btn-primary" @onclick="ExportPdf">Export to PDF</button>

<div @ref="@ItemToExport">
    <RadzenPanel AllowCollapse="false" class="px-5">
        <ChildContent>
            <RadzenTemplateForm TItem="string">
                <div class="text-center">
                    <RadzenImage Path="images/logo.png" Style="width: 220px; height:120px;" />
                </div>
                <div class="row p-3">
                    <h4 class="m-0 d-flex mb-3 fl align-items-center p-2 justify-content-center w-100" style="background:#244061; color:#FFF;">
                        <b>FORM TO BE COMPLETED BY THE NEW HIRE BASED ON THE INTERVIEWS</b>
                    </h4>
                    <div class="col-md-6">

                        <div class="row mb-2">
                            <div class="col-md-4 align-items-center d-flex">
                                <RadzenLabel Text="Name" />
                            </div>
                            <div class="col-md-6">
                                <RadzenTextBox style="width: 100%;" Name="CardNr" />
                            </div>
                        </div>
        </RadzenTemplateForm>
        </ChildContent>
    </RadzenPanel>
</div>
 
  ElementReference ItemToExport;

    async Task ExportPdf()
    {
        // Create a data URI from the elementRef
        var data = await DrawingService.ExportPDF(ItemToExport);
        // Save the Data URI to a file
        await DrawingService.SaveAs(data, "MyExport.pdf");
    }

  public class DrawingService
    {
        // The JavaScript namespace 
        const string JsNamespace = "ClientExporter";

        // IJSRuntime is resolved through DI
        public DrawingService(IJSRuntime js) => Js = js;

        public IJSRuntime Js { get; }

        /// <summary>
        /// Export an element from the page as a data image URI
        /// </summary>
        /// <param name="elementRef"></param>
        /// <returns>Data Image URI as a string</returns>
        public async ValueTask<string> ExportImage(ElementReference elementRef) =>
                      await Js.InvokeAsync<string>($"{JsNamespace}.exportImage", elementRef);

        /// <summary>
        /// Export an element from the page as a PDF formatted data URI
        /// </summary>
        /// <param name="elementRef"></param>
        /// <returns>Data URI as a string</returns>
        public async ValueTask<string> ExportPDF(ElementReference elementRef) =>
              await Js.InvokeAsync<string>($"{JsNamespace}.exportPDF", elementRef);

        /// <summary>
        /// Invokes the browser to save a Data URI formatted string to a file.
        /// </summary>
        /// <param name="dataUri">Data URI string</param>
        /// <param name="fileName">File name to save as</param>
        public async Task SaveAs(string dataUri, string fileName) =>
             await Js.InvokeVoidAsync($"{JsNamespace}.saveAs", dataUri, fileName);
    }

I recommend debugging your application to see what the exception is. We can't determine the cause of the problem from the provided information.

any luck to save to pdf using radzen components using with ADO.net