Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
DotNetify is an open-source framework made with .NET and Blazor designed for creating real-time web applications on a .NET platform. By utilizing SignalR's power for real-time interactions between the client and server, it simplifies the construction of dynamic and interactive web applications. DotNetify provides a programming model that synchronizes client-side views with server-side scripting data, allowing developers to design rich, responsive, and performant online interfaces quickly and easily.
Conversely, IronPDF PDF Generation Library is a potent .NET package that facilitates creating, editing, and manipulating PDF documents programmatically. It is an excellent choice for creating dynamic, data-driven documents like reports, invoices, and forms, offering an intuitive API for transforming HTML text into PDFs.
By integrating DotNetify with IronPDF, real-time web interactivity and robust PDF production capabilities are combined in a C# application. This integration is particularly beneficial for applications requiring real-time data display and the ability to dynamically create and distribute PDF documents based on the most recent data. Developers can create extensive, interactive online apps that address complex business requirements and enhance user experiences through seamless document generation and distribution by leveraging IronPDF's versatile PDF generation and DotNetify's real-time data synchronization.
DotNetify is an open-source framework designed to simplify creating interactive, real-time web apps with .NET and Blazor. Developers can create dynamic and responsive user interfaces that effortlessly synchronize with server-side data by utilizing SignalR, facilitating real-time communication between the client and server. DotNetify uses a reactive programming approach, abstracting the complexities of real-time data binding and event handling, thereby simplifying the creation of complex online applications with minimal code.
DotNetify allows developers to construct server-side view models that immediately propagate changes to the client, ensuring that the user interface always reflects the application's state. This framework offers flexibility in choosing client-side technology, supporting both classic JavaScript front-ends and Blazor front-ends. It is ideal for applications requiring real-time updates, such as dashboards, collaborative tools, and live data streams, due to its ease of use and effectiveness.
DotNetify's real-time handling of intricate interactions and data flows significantly enhances user experience by enabling smooth data synchronization and immediate feedback. Overall, DotNetify is a valuable tool for .NET developers aiming to build reactive, cutting-edge, real-time online applications quickly and efficiently.
DotNetify in C# offers a myriad of features that simplify the creation of interactive, real-time online apps, including:
To establish a simple project and begin configuring DotNetify in a C# online application, follow these steps. This tutorial demonstrates how to use ASP.NET Core and Blazor to set up a basic DotNetify server and client.
To configure DotNetify, open Startup.cs
and use the ConfigureServices
and Configure
methods.
using DotNetify;
using DotNetify.Blazor;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSignalR();
services.AddDotNetify();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
endpoints.MapHub<DotNetifyHub>("/dotnetify");
});
}
}
using DotNetify;
using DotNetify.Blazor;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSignalR();
services.AddDotNetify();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
endpoints.MapHub<DotNetifyHub>("/dotnetify");
});
}
}
Imports DotNetify
Imports DotNetify.Blazor
Public Class Startup
Public Sub ConfigureServices(ByVal services As IServiceCollection)
services.AddRazorPages()
services.AddServerSideBlazor()
services.AddSignalR()
services.AddDotNetify()
End Sub
Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IWebHostEnvironment)
If env.IsDevelopment() Then
app.UseDeveloperExceptionPage()
Else
app.UseExceptionHandler("/Error")
app.UseHsts()
End If
app.UseHttpsRedirection()
app.UseStaticFiles()
app.UseRouting()
app.UseEndpoints(Sub(endpoints)
endpoints.MapBlazorHub()
endpoints.MapFallbackToPage("/_Host")
endpoints.MapHub(Of DotNetifyHub)("/dotnetify")
End Sub)
End Sub
End Class
Create a new class file in your project (for example, HelloWorldViewModel.cs) and design a basic ViewModel.
using DotNetify;
public class HelloWorldViewModel : BaseVM
{
public string Greetings => "Hello, World!";
}
using DotNetify;
public class HelloWorldViewModel : BaseVM
{
public string Greetings => "Hello, World!";
}
Imports DotNetify
Public Class HelloWorldViewModel
Inherits BaseVM
Public ReadOnly Property Greetings() As String
Get
Return "Hello, World!"
End Get
End Property
End Class
Before registering the ViewModel, open Program.cs
.
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureServices(services =>
{
services.AddTransient<HelloWorldViewModel>();
});
}
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureServices(services =>
{
services.AddTransient<HelloWorldViewModel>();
});
}
Imports Microsoft.AspNetCore.Hosting
Imports Microsoft.Extensions.DependencyInjection
Imports Microsoft.Extensions.Hosting
Public Class Program
Public Shared Sub Main(ByVal args() As String)
CreateHostBuilder(args).Build().Run()
End Sub
Public Shared Function CreateHostBuilder(ByVal args() As String) As IHostBuilder
Return Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(Sub(webBuilder)
webBuilder.UseStartup(Of Startup)()
End Sub).ConfigureServices(Sub(services)
services.AddTransient(Of HelloWorldViewModel)()
End Sub})
End Function
In your project, add a new Blazor component (such as HelloWorld.razor) and connect it to the ViewModel.
@page "/"
@using DotNetify
@using DotNetify.Blazor
@inject IDotNetifyService DotNetify
<h3>@greetings</h3>
@code {
private string greetings;
protected override async Task OnInitializedAsync()
{
var vm = await DotNetify.ConnectAsync<HelloWorldViewModel>(this);
greetings = vm.Greetings;
}
}
To use DotNetify and IronPDF, you need to create a .NET project and incorporate both libraries into your application. Here's a step-by-step tutorial to get you started:
The feature-rich .NET library IronPDF PDF Library enables C# programs to produce, read, and edit PDF documents. With this library, developers can quickly turn HTML, CSS, and JavaScript information into high-quality, print-ready PDFs. Key tasks include adding headers and footers, splitting and merging PDFs, watermarking documents, and converting HTML to PDF.
IronPDF is relevant to a variety of applications because it supports both .NET Framework and .NET Core. With their simplicity of use and abundant information, PDFs can be easily integrated into developers' products. IronPDF handles complex data layouts and formatting, ensuring the PDFs it generates closely resemble the client's original HTML text. Additionally, IronPDF supports cross-platform apps like Windows, web, and mobile environments.
PDF Generation from HTML: Convert JavaScript, HTML, and CSS to PDF. IronPDF supports media queries and responsive design, two contemporary web standards. Its support for modern web standards is useful for dynamically decorating PDF invoices, reports, and documents with HTML and CSS.
PDF Editing: Pre-existing PDFs can have text, images, and other content added to them. Developers can use IronPDF to extract text and images from PDF files, combine multiple PDFs into one file, split PDF files into several separate papers, and include watermarks, annotations, headers, and footers.
PDF Conversion: Convert several file formats, including Word, Excel, and picture files, to PDF format. IronPDF also supports PDF-to-image conversion (PNG, JPEG, etc.).
To gain the tools needed to work with PDFs in .NET projects, install the IronPDF package.
Install-Package IronPdf
Configure DotNetify:
Startup Configuration: Open Startup.cs
and configure DotNetify using the ConfigureServices
and Configure
methods.
using DotNetify;
using DotNetify.Blazor;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSignalR();
services.AddDotNetify();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
endpoints.MapHub<DotNetifyHub>("/dotnetify");
});
}
}
using DotNetify;
using DotNetify.Blazor;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSignalR();
services.AddDotNetify();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapBlazorHub();
endpoints.MapFallbackToPage("/_Host");
endpoints.MapHub<DotNetifyHub>("/dotnetify");
});
}
}
Imports DotNetify
Imports DotNetify.Blazor
Public Class Startup
Public Sub ConfigureServices(ByVal services As IServiceCollection)
services.AddRazorPages()
services.AddServerSideBlazor()
services.AddSignalR()
services.AddDotNetify()
End Sub
Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IWebHostEnvironment)
If env.IsDevelopment() Then
app.UseDeveloperExceptionPage()
Else
app.UseExceptionHandler("/Error")
app.UseHsts()
End If
app.UseHttpsRedirection()
app.UseStaticFiles()
app.UseRouting()
app.UseEndpoints(Sub(endpoints)
endpoints.MapBlazorHub()
endpoints.MapFallbackToPage("/_Host")
endpoints.MapHub(Of DotNetifyHub)("/dotnetify")
End Sub)
End Sub
End Class
Add a new class file in your project (e.g., PdfViewModel.cs) and create a ViewModel that will produce a PDF.
using DotNetify;
using IronPdf;
public class PdfViewModel : BaseVM
{
public string PdfUrl { get; set; }
public void GeneratePdf()
{
// Create a new PDF renderer instance
var Renderer = new ChromePdfRenderer();
// Render HTML as a PDF document
var PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");
// Define the output path for saving the PDF
var OutputPath = "wwwroot/PdfFiles/HelloWorld.pdf";
// Save the generated PDF document
PdfDocument.SaveAs(OutputPath);
// Update the property for the PDF URL
PdfUrl = "/PdfFiles/HelloWorld.pdf";
Changed(nameof(PdfUrl));
}
}
using DotNetify;
using IronPdf;
public class PdfViewModel : BaseVM
{
public string PdfUrl { get; set; }
public void GeneratePdf()
{
// Create a new PDF renderer instance
var Renderer = new ChromePdfRenderer();
// Render HTML as a PDF document
var PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>");
// Define the output path for saving the PDF
var OutputPath = "wwwroot/PdfFiles/HelloWorld.pdf";
// Save the generated PDF document
PdfDocument.SaveAs(OutputPath);
// Update the property for the PDF URL
PdfUrl = "/PdfFiles/HelloWorld.pdf";
Changed(nameof(PdfUrl));
}
}
Imports DotNetify
Imports IronPdf
Public Class PdfViewModel
Inherits BaseVM
Public Property PdfUrl() As String
Public Sub GeneratePdf()
' Create a new PDF renderer instance
Dim Renderer = New ChromePdfRenderer()
' Render HTML as a PDF document
Dim PdfDocument = Renderer.RenderHtmlAsPdf("<h1>Hello World!</h1>")
' Define the output path for saving the PDF
Dim OutputPath = "wwwroot/PdfFiles/HelloWorld.pdf"
' Save the generated PDF document
PdfDocument.SaveAs(OutputPath)
' Update the property for the PDF URL
PdfUrl = "/PdfFiles/HelloWorld.pdf"
Changed(NameOf(PdfUrl))
End Sub
End Class
Create a Blazor component by adding a new component (e.g., GeneratePdf.razor) and binding it to the ViewModel.
@page "/"
@using DotNetify
@using DotNetify.Blazor
@inject IDotNetifyService DotNetify
<PageTitle>Generate PDF</PageTitle>
<h3>Generate PDF</h3>
<button @onclick="GeneratePdf">Generate PDF</button>
@if (!string.IsNullOrEmpty(pdfUrl))
{
<a href="@pdfUrl" target="_blank">Download PDF</a>
}
@code {
private string pdfUrl;
protected override async Task OnInitializedAsync()
{
var vm = await DotNetify.ConnectAsync<PdfViewModel>(this);
pdfUrl = vm.PdfUrl;
vm.PropertyChanged += (sender, args) =>
{
if (args.PropertyName == nameof(vm.PdfUrl))
{
pdfUrl = vm.PdfUrl;
StateHasChanged();
}
};
}
private void GeneratePdf()
{
DotNetify.CallMethod("GeneratePdf");
}
}
By integrating DotNetify and IronPDF in a C# ASP.NET Core Blazor application, real-time data handling and dynamic PDF production are made possible. The setup begins with configuring the project in Startup.cs, where services for Razor Pages, Blazor Server, SignalR, and DotNetify are registered to enable server-side Blazor and real-time features.
In PdfViewModel.cs, IronPDF's PDF generation logic is defined. The PDF file can be generated with just a few lines of code. The GeneratePdf
function converts HTML content into a PDF and updates the PdfUrl property, informing the client of the new file's location. Communication with the GeneratePdf.razor Blazor component is handled by this ViewModel.
The component connects to the PdfViewModel via the IDotNetifyService and binds to its properties, enabling the client to call the GeneratePdf
function and respond to property changes. When users click the "Generate PDF" button, the ViewModel's method is invoked, creating the PDF and dynamically updating the download URL. With this configuration, the web application delivers a responsive and engaging user experience by combining IronPDF's powerful document-generating capabilities with DotNetify's real-time data synchronization.
Integrating DotNetify with IronPDF combines real-time data synchronization and dynamic PDF production in a C# ASP.NET Core Blazor application. DotNetify enables seamless communication between client-side Blazor components and server-side ViewModels, leading to interactive and responsive applications. This is complemented by IronPDF, which provides robust tools for creating and modifying PDFs directly from server-side logic. This powerful combination permits the development of applications capable of creating and distributing customized documents, as well as real-time updates.
This integration leverages real-time data handling and document generation technologies to enhance user experience, whether for reporting, invoicing, or any other document-related task. By following the outlined steps, developers can efficiently set up and utilize these tools, unlocking new possibilities in modern web application development.
With IronPDF and Iron Software Developer Tools, developers eager to explore its extensive features can utilize functionalities like OCR, barcode scanning, PDF production, and more. Provided license alternatives related to the project are specified in detail, allowing developers to choose the best model that fits their needs. The listed advantages contribute to developers delivering timely, coordinated, and effective solutions for a multitude of challenges.
DotNetify is an open-source framework designed to simplify creating interactive, real-time web apps with .NET and Blazor. It uses SignalR for real-time client-server communication, allowing developers to create dynamic and responsive user interfaces.
DotNetify leverages SignalR to facilitate real-time communication between the client and server, enabling interactive user interfaces and instant updates.
Key features of DotNetify include real-time communication, a reactive programming model, support for Blazor and JavaScript, ease of integration, scalability, MVVM architecture, and extensibility.
Using IronPDF in a C# application allows for the combination of real-time web interactivity with robust PDF production capabilities, enabling dynamic data display and PDF document creation.
IronPDF is a feature-rich .NET library that enables the production, reading, and editing of PDF documents. It converts HTML, CSS, and JavaScript into high-quality PDFs and supports various PDF manipulations.
IronPDF is useful for generating reports, invoices, forms, and any dynamic data-driven PDF documents. It supports PDF editing, conversion from other formats, and PDF generation from HTML.
DotNetify supports both classic JavaScript and Blazor front-ends, allowing developers to choose the client-side technology that best fits their application requirements.
The MVVM (Model-View-ViewModel) architecture in DotNetify aids in separating responsibilities and maintaining organized and clean code, simplifying state management and data flow within the application.
DotNetify is ideal for real-time applications due to its real-time communication capabilities, ease of use, and effectiveness in managing complex data flows and interactions for applications like dashboards and live data streams.
The combination offers the ability to handle real-time data and dynamically generate and distribute PDF documents, enhancing user experience and addressing complex business requirements efficiently.