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

Cannot Convert HTML to PDF

Hi,


I am trying to convert HTML into PDF using a Blazor WASM hosted (with server side) in .Net 7 and i cannot get it to work. 


If we implement it exactly as you have it in your example here: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/blazor


we get this error


blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Value cannot be null. (Parameter 'uriString')
System.ArgumentNullException: Value cannot be null. (Parameter 'uriString')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
   at System.Uri..ctor(String uriString)
   at Syncfusion.HtmlConverter.BlinkConverterSettings..ctor()
   at Syncfusion.HtmlConverter.HtmlToPdfConverter.set_RenderingEngine(HtmlRenderingEngine value)
   at Syncfusion.HtmlConverter.HtmlToPdfConverter..ctor()
   at Tonbridge_App.Client.Shared.Services.ExportService.CreatePdf()
   at Tonbridge_App.Client.Pages.Timetable.Viewer.Component.ExportToPdf()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


I can't run the linked code example as it's using .net 3.1 which is no longer supported.




1 Reply

SN Santhiya Narayanan Syncfusion Team April 6, 2023 11:46 AM UTC

Our HTML to PDF converter only supported in Blazor server side, currently it is not supported in Blazor WASM. So, kindly try the conversion with Blazor server side application.


Loader.
Live Chat Icon For mobile
Up arrow icon