將 ASPX 轉換為 PDF
.NET跨平臺應用介面(.NET MAUI)是用C#和XAML建立原生行動和桌面應用的跨平臺框架。 您可以使用.NET MAUI在Android、iOS、macOS和Windows上操作,並使用單一程式碼庫。 .NET MAUI是開源的,是對Xamarin Forms的改進。 介面控制項從頭開始重寫以提高效能和可擴充性。 此外,它已從行動平台擴展到包括桌面使用案例。 如果您曾經使用Xamarin Forms來建立跨平台的使用者介面,您會發現.NET MAUI框架與之有很多共同之處。
然而,存在一些差異。 您可以使用.NET MAUI框架通過單個專案構建多平台應用,但如有需要您可以新增平台特定的程式碼和資源。 .NET MAUI的主要目標之一是讓您可以儘可能多地在單一程式碼庫中撰寫應用程式邏輯和使用者介面佈局。 .NET MAUI將可用於所有平臺,並支持現有的MVVM和XAML模式。
.NET MAUI允許開發者在行動開發和Windows平台等各種平臺上工作。
IronPDF功能
IronPDF是一個強大的PDF轉換器,可以處理幾乎瀏覽器可以處理的任何任務。 .NET程式庫讓開發者輕鬆建立、閱讀和操作PDF文件。 IronPDF使用Google Chrome引擎將HTML轉換為PDF文件。 IronPDF支持的網頁技術包括HTML、ASPX、將Razor頁面轉換為PDF和MVC視圖。 IronPDF支持Microsoft .NET應用(包括ASP.NET Web應用和傳統Windows應用)。 IronPDF還可以用來製作精美的PDF文件。
IronPDF可以從包含JavaScript、CSS和圖像文件的HTML文件建立PDF文件。
不僅可以用IronPDF將HTML文件轉換成PDF,還可以將圖片文件轉換成PDF。
IronPDF可以幫助建立互動式PDF文件、使用IronPDF填寫和提交互動式表單、合併和拆分PDF文件、從PDF文件中提取文字和圖片、搜尋PDF文件中的文字、將PDF頁面光柵化為圖像,將PDF轉換為HTML,並使用IronPrint列印PDF文件。
IronPDF可以從URL生成文件。 對於使用HTML使用IronPDF進行登入表單的登入,它還允許使用自訂的網路登入憑證、使用者代理、代理、cookie、HTTP頭和表單變數。
IronPDF是可以讀取和填寫PDF文件並能夠從文件中提取圖片的程式庫。 它允許我們向PDF文件新增標頭和頁腳、文字、照片、書籤以便於導航、水印和更多內容。 它還允許我們加入和拆分新文件或現有文件中的頁面。 IronPDF能夠在不使用Acrobat查看器的情況下將文件轉換為PDF物件。 還可以將CSS文件轉換為PDF文件,CSS媒體型別文件可以轉換為文件。
如何在.NET MAUI中建立PDF文件
- 在Visual Studio中建立新的.NET MAUI PDF專案
- 使用NuGet安裝IronPDF程式庫
- 設計.NET MAUI內容頁的UI
- 使用
ChromePdfRenderer.RenderHtmlAsPdf方法生成PDF文件 - 將PDF文件以平台特定的程式碼儲存到使用者裝置。
在Visual Studio中建立新專案
首先,使用Visual Studio Code和Visual Studio建立項目。 使用Visual Studio Code時,必須使用命令行工具安裝項目型別模板。
打開Microsoft Visual Studio軟體並進入"文件"選單。 選擇"新專案",在新專案窗口中選擇".NET MAUI應用"。本文將使用.NET MAUI應用生成PDF文件並將其儲存到合適的位置。
在.NET MAUI中使用IronPDF建立PDF文件,圖1:在Visual Studio中建立新專案 在Visual Studio中建立新專案
在適當的文字框中輸入專案名稱並選擇文件路徑。 然後,單擊下面截圖中的建立按鈕。
在.NET MAUI中使用IronPDF建立PDF文件,圖2:配置專案 配置專案
Visual Studio專案現在將根據.NET MAUI應用平台生成所選應用程式的結構。 現在它將打開MainPage.cs文件,以新增程式碼並構建/運行應用程式。
在.NET MAUI中使用IronPDF建立PDF文件,圖3:將程式碼新增到MainPage.cs文件 將程式碼新增到MainPage.cs文件
接下來,安裝該程式庫以測試程式碼。
安裝IronPDF Library
IronPDF程式庫可以通過四種方式下載和安裝。
這些是:
- 使用Visual Studio。
- 使用Visual Studio命令行。
- 從NuGet網站直接下載。
- 從IronPDF網站直接下載。
使用Visual Studio
Visual Studio軟體提供NuGet包管理選項,可以直接將包安裝到解決方案中。 下面的截圖顯示了如何打開NuGet包管理器。
在.NET MAUI中使用IronPDF建立PDF文件,圖4:導航到使用NuGet Package Manager UI 導航到NuGet Package Manager UI
提供搜索框以顯示來自NuGet網站的程式包列表。在NuGet Package Manager中,搜索關鍵字"IronPDF",如下圖所示。
在.NET MAUI中使用IronPDF建立PDF文件,圖5:從NuGet Package Manager UI中選擇IronPDF程式包 IronPDF程式包來自NuGet Package Manager UI
在上圖中,列出了相關的搜索項,選擇第一個選項來將程式包安裝到解決方案中。 它將安裝在所有.NET MAUI應用平台上,如Android、iOS和Windows平台上。
使用Visual Studio命令行
In Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console
在套件管理器主控台標籤中輸入以下行:
Install-Package IronPdf
現在,將程式包下載/安裝到當前專案中的所有.NET MAUI平臺上並準備使用。
在.NET MAUI中使用IronPDF建立PDF文件,圖6:在Package Manager Console中安裝程式包 在Package Manager Console中安裝程式包
從NuGet網站直接下載
第三種方式是直接從他們的網站下載NuGet程式包,通過存取此IronPDF NuGet repository page。
- 從右側選單中選擇下載程式包選項。
- 雙擊下載的程式包。 它將會自動安裝。
- 重新載入解決方案,程式包應可在專案中使用。
從IronPDF網站直接下載
直接從他們的網站下載最新的IronPDF ZIP程式包。下載完成後,請按以下步驟將該程式包新增到您的專案中。
- 右鍵單擊解決方案窗口中專案的依賴項選項。
- 選擇特定平台,然後選擇選項引用並瀏覽到下載的引用位置。
- 單擊確定以新增引用。
您還需要新增對所有.NET MAUI支持平台的引用。
使用IronPDF在.NET MAUI應用中建立PDF文件
建立項目時,會自動生成一個名為MainPage.xaml的文件。 這是放置.NET MAUI應用程式UI的地方。
遵循下面的程式碼。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI_PDF.MainPage"
>
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute .NET bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />
<Label
Text="Welcome to IronPDF!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
<Button
x:Name="PdfBtn"
Text="Click me to generate PDF"
SemanticProperties.Hint="Click button to generate PDF"
Clicked="GeneratePDF"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MAUI_PDF.MainPage"
>
<ScrollView>
<VerticalStackLayout
Spacing="25"
Padding="30,0"
VerticalOptions="Center">
<Image
Source="dotnet_bot.png"
SemanticProperties.Description="Cute .NET bot waving hi to you!"
HeightRequest="200"
HorizontalOptions="Center" />
<Label
Text="Welcome to IronPDF!"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
<Button
x:Name="PdfBtn"
Text="Click me to generate PDF"
SemanticProperties.Hint="Click button to generate PDF"
Clicked="GeneratePDF"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
將上述程式碼新增到MainPage.xaml.cs文件,並在MainPage類裡面包含以下方法:
private void GeneratePDF(object sender, EventArgs e)
{
ChromePdfRenderer renderer = new ChromePdfRenderer();
var doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>");
// Saves the memory stream as file.
SaveService saveService = new SaveService();
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream);
}
private void GeneratePDF(object sender, EventArgs e)
{
ChromePdfRenderer renderer = new ChromePdfRenderer();
var doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>");
// Saves the memory stream as file.
SaveService saveService = new SaveService();
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream);
}
Private Sub GeneratePDF(ByVal sender As Object, ByVal e As EventArgs)
Dim renderer As New ChromePdfRenderer()
Dim doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>")
' Saves the memory stream as file.
Dim saveService As New SaveService()
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream)
End Sub
GeneratePDF這個方法生成包含文字"Hello, IronPDF!..."的新PDF文件,並將其儲存在使用者的電腦上的指定位置。
在上面的方法中,建立了一個新ChromePdfRenderer物件並調用RenderHtmlAsPdf方法生成包含文字"Hello IronPDF!"的新PDF文件。 ..."來自HTML標記字串。接下來,會被委派將文件儲存到使用者裝置的任務給一個名為SaveService的單獨類。這個類將在下一步中建立。
完整的MainPage.xaml.cs文件如下。 請確保文件內容與以下內容相符,然後再繼續下一步:
// Change the namespace as desired, but make sure that all source files use this same namespace,
// or there will be errors!
namespace MAUI_IronPDF;
// This namespace is required to make use of IronPDF functionality
using IronPdf;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void GeneratePDF(object sender, EventArgs e)
{
ChromePdfRenderer renderer = new ChromePdfRenderer();
var doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>");
// Saves the memory stream as file.
SaveService saveService = new SaveService();
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream);
}
}
// Change the namespace as desired, but make sure that all source files use this same namespace,
// or there will be errors!
namespace MAUI_IronPDF;
// This namespace is required to make use of IronPDF functionality
using IronPdf;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void GeneratePDF(object sender, EventArgs e)
{
ChromePdfRenderer renderer = new ChromePdfRenderer();
var doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>");
// Saves the memory stream as file.
SaveService saveService = new SaveService();
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream);
}
}
Imports IronPdf
' Change the namespace as desired, but make sure that all source files use this same namespace,
' or there will be errors!
Namespace MAUI_IronPDF
' This namespace is required to make use of IronPDF functionality
Partial Public Class MainPage
Inherits ContentPage
Public Sub New()
InitializeComponent()
End Sub
Private Sub GeneratePDF(ByVal sender As Object, ByVal e As EventArgs)
Dim renderer As New ChromePdfRenderer()
Dim doc = renderer.RenderHtmlAsPdf("<h1>Hello IronPDF!</h1> <p>I'm using IronPDF MAUI!</p>")
' Saves the memory stream as file.
Dim saveService As New SaveService()
saveService.SaveAndView("IronPDF HTML string.pdf", "application/pdf", doc.Stream)
End Sub
End Class
End Namespace
現在,在專案根目錄中建立一個名為SaveService.cs的新類文件,並新增以下原始碼:
// Change the namespace as desired, but make sure that all source files use this same namespace,
// or there will be errors!
namespace MAUI_IronPDF
{
// SaveService partial class declaration ... this allows a layer of abstraction
// as we implement the save file details specially for each platform on which this app will
// operate!
public partial class SaveService
{
public void SaveAndView(string filename, string contentType, MemoryStream stream)
{
SaveFile(filename, contentType, stream);
}
// Additional partial files will provide implementations for this method specifically.
partial void SaveFile(string filename, string contentType, MemoryStream stream);
}
}
// Change the namespace as desired, but make sure that all source files use this same namespace,
// or there will be errors!
namespace MAUI_IronPDF
{
// SaveService partial class declaration ... this allows a layer of abstraction
// as we implement the save file details specially for each platform on which this app will
// operate!
public partial class SaveService
{
public void SaveAndView(string filename, string contentType, MemoryStream stream)
{
SaveFile(filename, contentType, stream);
}
// Additional partial files will provide implementations for this method specifically.
partial void SaveFile(string filename, string contentType, MemoryStream stream);
}
}
' Change the namespace as desired, but make sure that all source files use this same namespace,
' or there will be errors!
Namespace MAUI_IronPDF
' SaveService partial class declaration ... this allows a layer of abstraction
' as we implement the save file details specially for each platform on which this app will
' operate!
Partial Public Class SaveService
Public Sub SaveAndView(ByVal filename As String, ByVal contentType As String, ByVal stream As MemoryStream)
SaveFile(filename, contentType, stream)
End Sub
' Additional partial files will provide implementations for this method specifically.
Partial Private Sub SaveFile(ByVal filename As String, ByVal contentType As String, ByVal stream As MemoryStream)
End Sub
End Class
End Namespace
由於在使用者裝置上儲存內容的實現細節因每個平臺(Windows,Android,macOS等)而異,因此需要為應用程式支持的每種型別的裝置編寫平台特定的程式碼。 為了使這成為可能,我們將SaveAndView的部分類(出於抽象目標)的部分方法。 接下來,在解決方案資源管理器中Platforms文件夾內的其中一個或多個文件夾中將該方法的實現定義為一個獨立的SaveService.cs部分類(見下圖):
在.NET MAUI中使用IronPDF建立PDF文件,圖7:實現跨平臺的文件夾結構 實現跨平臺的文件夾結構
為了簡便起見,本教程將為Windows平台定義上述部分文件。 在Windows平台文件夾下建立一個包含以下程式碼的SaveService.cs文件:
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.Storage.Streams;
using Windows.UI.Popups;
namespace MAUI_IronPDF;
public partial class SaveService
{
async partial void SaveFile(string filename, string contentType, MemoryStream stream)
{
StorageFile stFile;
string extension = Path.GetExtension(filename);
// Gets process windows handle to open the dialog in application process.
IntPtr windowHandle = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
// Creates file save picker to save a file.
FileSavePicker savePicker = new();
savePicker.DefaultFileExtension = ".pdf";
savePicker.SuggestedFileName = filename;
// Saves the file as PDF file.
savePicker.FileTypeChoices.Add("PDF", new List<string>() { ".pdf" });
WinRT.Interop.InitializeWithWindow.Initialize(savePicker, windowHandle);
stFile = await savePicker.PickSaveFileAsync();
}
else
{
StorageFolder local = ApplicationData.Current.LocalFolder;
stFile = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
}
if (stFile != null)
{
using (IRandomAccessStream zipStream = await stFile.OpenAsync(FileAccessMode.ReadWrite))
{
// Writes compressed data from memory to file.
using Stream outstream = zipStream.AsStreamForWrite();
outstream.SetLength(0);
// Saves the stream as file.
byte [] buffer = stream.ToArray();
outstream.Write(buffer, 0, buffer.Length);
outstream.Flush();
}
// Create message dialog box.
MessageDialog msgDialog = new("Do you want to view the document?", "File has been created successfully");
UICommand yesCmd = new("Yes");
msgDialog.Commands.Add(yesCmd);
UICommand noCmd = new("No");
msgDialog.Commands.Add(noCmd);
WinRT.Interop.InitializeWithWindow.Initialize(msgDialog, windowHandle);
// Showing a dialog box.
IUICommand cmd = await msgDialog.ShowAsync();
if (cmd.Label == yesCmd.Label)
{
// Launch the saved file.
await Windows.System.Launcher.LaunchFileAsync(stFile);
}
}
}
}
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.Storage.Streams;
using Windows.UI.Popups;
namespace MAUI_IronPDF;
public partial class SaveService
{
async partial void SaveFile(string filename, string contentType, MemoryStream stream)
{
StorageFile stFile;
string extension = Path.GetExtension(filename);
// Gets process windows handle to open the dialog in application process.
IntPtr windowHandle = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
// Creates file save picker to save a file.
FileSavePicker savePicker = new();
savePicker.DefaultFileExtension = ".pdf";
savePicker.SuggestedFileName = filename;
// Saves the file as PDF file.
savePicker.FileTypeChoices.Add("PDF", new List<string>() { ".pdf" });
WinRT.Interop.InitializeWithWindow.Initialize(savePicker, windowHandle);
stFile = await savePicker.PickSaveFileAsync();
}
else
{
StorageFolder local = ApplicationData.Current.LocalFolder;
stFile = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
}
if (stFile != null)
{
using (IRandomAccessStream zipStream = await stFile.OpenAsync(FileAccessMode.ReadWrite))
{
// Writes compressed data from memory to file.
using Stream outstream = zipStream.AsStreamForWrite();
outstream.SetLength(0);
// Saves the stream as file.
byte [] buffer = stream.ToArray();
outstream.Write(buffer, 0, buffer.Length);
outstream.Flush();
}
// Create message dialog box.
MessageDialog msgDialog = new("Do you want to view the document?", "File has been created successfully");
UICommand yesCmd = new("Yes");
msgDialog.Commands.Add(yesCmd);
UICommand noCmd = new("No");
msgDialog.Commands.Add(noCmd);
WinRT.Interop.InitializeWithWindow.Initialize(msgDialog, windowHandle);
// Showing a dialog box.
IUICommand cmd = await msgDialog.ShowAsync();
if (cmd.Label == yesCmd.Label)
{
// Launch the saved file.
await Windows.System.Launcher.LaunchFileAsync(stFile);
}
}
}
}
Imports Windows.Storage
Imports Windows.Storage.Pickers
Imports Windows.Storage.Streams
Imports Windows.UI.Popups
Namespace MAUI_IronPDF
Partial Public Class SaveService
Private Async Sub SaveFile(ByVal filename As String, ByVal contentType As String, ByVal stream As MemoryStream)
Dim stFile As StorageFile
Dim extension As String = Path.GetExtension(filename)
' Gets process windows handle to open the dialog in application process.
Dim windowHandle As IntPtr = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle
If Not Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons") Then
' Creates file save picker to save a file.
Dim savePicker As New FileSavePicker()
savePicker.DefaultFileExtension = ".pdf"
savePicker.SuggestedFileName = filename
' Saves the file as PDF file.
savePicker.FileTypeChoices.Add("PDF", New List(Of String)() From {".pdf"})
WinRT.Interop.InitializeWithWindow.Initialize(savePicker, windowHandle)
stFile = Await savePicker.PickSaveFileAsync()
Else
Dim local As StorageFolder = ApplicationData.Current.LocalFolder
stFile = Await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting)
End If
If stFile IsNot Nothing Then
Using zipStream As IRandomAccessStream = Await stFile.OpenAsync(FileAccessMode.ReadWrite)
' Writes compressed data from memory to file.
Using outstream As Stream = zipStream.AsStreamForWrite()
outstream.SetLength(0)
' Saves the stream as file.
Dim buffer() As Byte = stream.ToArray()
outstream.Write(buffer, 0, buffer.Length)
outstream.Flush()
End Using
End Using
' Create message dialog box.
Dim msgDialog As New MessageDialog("Do you want to view the document?", "File has been created successfully")
Dim yesCmd As New UICommand("Yes")
msgDialog.Commands.Add(yesCmd)
Dim noCmd As New UICommand("No")
msgDialog.Commands.Add(noCmd)
WinRT.Interop.InitializeWithWindow.Initialize(msgDialog, windowHandle)
' Showing a dialog box.
Dim cmd As IUICommand = Await msgDialog.ShowAsync()
If cmd.Label = yesCmd.Label Then
' Launch the saved file.
Await Windows.System.Launcher.LaunchFileAsync(stFile)
End If
End If
End Sub
End Class
End Namespace
構建並運行MAUI應用。 一個包含以下介面的窗口將會出現:
在.NET MAUI中使用IronPDF建立PDF文件,圖8:MAUI應用的UI MAUI應用的UI
點擊"生成PDF"按鈕。 片刻之後,會出現一個彈出窗口以選擇生成的PDF文件的儲存位置。
在.NET MAUI中使用IronPDF建立PDF文件,圖9:選擇保存PDF文件的位置 選擇保存PDF文件的位置
結論
IronPDF是最常用的PDF轉換庫之一,允許您生成、閱讀、編輯和格式化PDF文件。 IronPDF庫提供了許多優勢和功能,其中包括幫助將給定URL轉換為PDF文件的瀏覽器引擎,允許您將CSS新增到HTML字串中並將它們轉換為PDF文件,還允許您填寫PDF表單。 IronPDF的所有功能都包含在一個庫中。
IronPDF有多種價格結構。 IronPDF的基本價格從$999起。 產品支持和更新也可以以年度費用獲得。 免版稅再分發範圍也可以作為附加選項進行購買。
總之,IronPDF因為它在處理PDF的開發者中提供了出色的效能和大量的功能,因此推薦使用。 它支持像.NET MAUI這樣的通用平臺。 它還提供了優秀的幫助和文件,允許您充分利用IronPDF程式庫及其眾多功能。
常見問題
如何在.NET MAUI應用程式中生成PDF文件?
要在.NET MAUI應用程式中生成PDF文件,您可以使用IronPDF。首先在Visual Studio中設置一個.NET MAUI項目,通過NuGet安裝IronPDF,並使用ChromePdfRenderer.RenderHtmlAsPdf方法將HTML內容轉換為PDF文件。
.NET MAUI何以適合跨平台應用程式開發?
.NET MAUI適合跨平台應用程式開發,因為它允許開發者使用C#和XAML從單一程式碼庫中建立適用於Android、iOS、macOS和Windows的本地行動和桌面應用程式。
IronPDF如何在PDF轉換中處理HTML、CSS和JavaScript?
IronPDF使用Google Chrome引擎來精確地將HTML、CSS和JavaScript渲染成PDF格式,確保網頁在轉換時不會丟失格式。
在.NET MAUI應用程式中保存PDF文件的流程是什麼?
在使用IronPDF的.NET MAUI應用程式中,使用SaveService類來保存PDF文件。它包含平台特定的實現,以處理在Windows和Android等操作系統上的文件保存。
IronPDF在.NET應用程式中可用的高級功能有哪些?
IronPDF提供高級功能,例如建立互動式PDF,填寫和提交表單,合併和拆分文件,提取文字和圖片,以及新增頁眉、頁腳和水印。
如何在Visual Studio中將IronPDF整合到.NET MAUI項目中?
要將IronPDF整合到.NET MAUI項目中,請在Visual Studio中使用NuGet包管理器。搜索'IronPDF'並將其安裝到您的項目中,以開始生成和管理PDF。
IronPDF能否在.NET MAUI應用程式中將網頁URL轉換為PDF?
是的,IronPDF可以使用其網頁渲染功能將網頁URL準確地捕獲HTML、CSS和JavaScript內容並在PDF格式中渲染。
XAML在設計.NET MAUI應用程式的UI中扮演什麼角色?
XAML在.NET MAUI中用於設計應用程式的使用者介面。它允許開發者建立響應式且美觀的佈局,能順利運行於多個平台。
在.NET MAUI項目中使用IronPDF的好處是什麼?
IronPDF提供了易用性、廣泛的文件、良好的性能和處理各種PDF任務的能力,使其成為開發者處理.NET MAUI項目中PDF文件的可靠選擇。
IronPDF是否完全相容.NET 10,這帶來了哪些優勢?
是的,IronPDF完全相容.NET 10,並開箱即用地支持版本9、8、7、6、Core、Standard和Framework。使用IronPDF搭配.NET 10,您可以利用性能改進,例如降低堆分配、改進JIT/運行時行為和新的C#語言功能,使PDF生成和操作更快、更高效。




