- This is an Example of a free C# PDF library. As a standalone PDF component, Free Spire.PDF for.NET enables developers to create, write, edit, convert, print, handle and read PDF files on any.NET applications. You can implement rich capabilities to create PDF files from scratch or process existing PDF documents.
- Spire.PDF for.NET is a professional PDF API applied to creating, writing, editing, handling and reading PDF files without any external dependencies within.NET ( C#, VB.NET, ASP.NET,.NET Core, Xamarin ) application. Using this.NET PDF library, you can implement rich capabilities to create PDF files from scratch or process existing PDF documents entirely through C#/VB.NET without installing.
By Luke Latham and Daniel Roth
Razor components can be integrated into Razor Pages and MVC apps. When the page or view is rendered, components can be prerendered at the same time.
Apitron PDF Kit for.NET. Create, combine or edit PDF files on the fly with this 100% managed.NET component.Produce stunning documents using our unique, styles-driven flow layout engine. Unlock full power of the PDF using our fixed layout API - fully implemented according to specification. Xamarin & Mono compatible. PDFRasterizer.NET is a component for rendering PDF documents and is written entirely in C#. It has no dependencies other than the.NET framework and it is packaged as a single assembly which makes deployment truly easy. The component draws to any System.Drawing.Graphics object.
After preparing the app, use the guidance in the following sections depending on the app's requirements:
- Routable components: For components that are directly routable from user requests. Follow this guidance when visitors should be able to make an HTTP request in their browser for a component with an
@page
directive. - Render components from a page or view: For components that aren't directly routable from user requests. Follow this guidance when the app embeds components into existing pages and views with the Component Tag Helper.
Prepare the app
An existing Razor Pages or MVC app can integrate Razor components into pages and views:
- In the app's layout file (
_Layout.cshtml
):- Add the following
<base>
tag to the<head>
element:Thehref
value (the app base path) in the preceding example assumes that the app resides at the root URL path (/
). If the app is a sub-application, follow the guidance in the App base path section of the Host and deploy ASP.NET Core Blazor article.Garmin mapsource software 6.13 7 free. The_Layout.cshtml
file is located in the Pages/Shared folder in a Razor Pages app or Views/Shared folder in an MVC app. - Add a
<script>
tag for the blazor.server.js script immediately before the closing</body>
tag:The framework adds the blazor.server.js script to the app. There's no need to manually add the script to the app.
- Add an
_Imports.razor
file to the root folder of the project with the following content (change the last namespace,MyAppNamespace
, to the namespace of the app): - In
Startup.ConfigureServices
, register the Blazor Server service: - In
Startup.Configure
, add the Blazor Hub endpoint toapp.UseEndpoints
: - Integrate components into any page or view. For more information, see the Render components from a page or view section.
Use routable components in a Razor Pages app
This section pertains to adding components that are directly routable from user requests.
To support routable Razor components in Razor Pages apps:
- Follow the guidance in the Prepare the app section.
- Add an
App.razor
file to the project root with the following content: - Add a
_Host.cshtml
file to thePages
folder with the following content:Components use the shared_Layout.cshtml
file for their layout.RenderMode configures whether theApp
component:- Is prerendered into the page.
- Is rendered as static HTML on the page or if it includes the necessary information to bootstrap a Blazor app from the user agent.
Render Mode Description ServerPrerendered Renders the App
component into static HTML and includes a marker for a Blazor Server app. When the user-agent starts, this marker is used to bootstrap a Blazor app.Server Renders a marker for a Blazor Server app. Output from the App
component isn't included. When the user-agent starts, this marker is used to bootstrap a Blazor app.Static Renders the App
component into static HTML.For more information on the Component Tag Helper, see Component Tag Helper in ASP.NET Core. - Add a low-priority route for the
_Host.cshtml
page to endpoint configuration inStartup.Configure
: Mplab icd 3 driver windows 10. - Add routable components to the app. For example:
![Component Component](https://ia-discourse.s3.dualstack.us-west-1.amazonaws.com/optimized/3X/4/e/4efa004e0227cdbd699c715b05f7382cf9ba78e7_2_690x432.jpeg)
For more information on namespaces, see the Component namespaces section.
Use routable components in an MVC app
This section pertains to adding components that are directly routable from user requests.
To support routable Razor components in MVC apps:
- Follow the guidance in the Prepare the app section.
- Add an
App.razor
file to the root of the project with the following content: - Add a
_Host.cshtml
file to theViews/Home
folder with the following content:Components use the shared_Layout.cshtml
file for their layout.RenderMode configures whether theApp
component:- Is prerendered into the page.
- Is rendered as static HTML on the page or if it includes the necessary information to bootstrap a Blazor app from the user agent.
Render Mode Description ServerPrerendered Renders the App
component into static HTML and includes a marker for a Blazor Server app. When the user-agent starts, this marker is used to bootstrap a Blazor app.Server Renders a marker for a Blazor Server app. Output from the App
component isn't included. When the user-agent starts, this marker is used to bootstrap a Blazor app.Static Renders the App
component into static HTML.For more information on the Component Tag Helper, see Component Tag Helper in ASP.NET Core. - Add an action to the Home controller:
- Add a low-priority route for the controller action that returns the
_Host.cshtml
view to the endpoint configuration inStartup.Configure
: - Create a
Pages
folder and add routable components to the app. For example:
For more information on namespaces, see the Component namespaces section.
Render components from a page or view
This section pertains to adding components to pages or views, where the components aren't directly routable from user requests.
To render a component from a page or view, use the Component Tag Helper.
Render stateful interactive components
Stateful interactive components can be added to a Razor page or view.
When the page or view renders:
Programming .net Components Pdf
- The component is prerendered with the page or view.
- The initial component state used for prerendering is lost.
- New component state is created when the SignalR connection is established.
The following Razor page renders a
Counter
component:For more information, see Component Tag Helper in ASP.NET Core.
Render noninteractive components
In the following Razor page, the
Counter
component is statically rendered with an initial value that's specified using a form. Since the component is statically rendered, the component isn't interactive:For more information, see Component Tag Helper in ASP.NET Core.
Component namespaces
When using a custom folder to hold the app's components, add the namespace representing the folder to either the page/view or to the
_ViewImports.cshtml
file. In the following example: Neosat receiver software model 750m.- Change
MyAppNamespace
to the app's namespace. - If a folder named Components isn't used to hold the components, change
Components
to the folder where the components reside.
The
_ViewImports.cshtml
file is located in the Pages
folder of a Razor Pages app or the Views
folder of an MVC app..net Pdf Component
For more information, see Create and use ASP.NET Core Razor components.