HTML
JPG
PDF
XML
DOCX
PDF
Lấy Forms PDF trong .NET SDK
Xây dựng ứng dụng Cloud của riêng bạn để lấy tập tin tài liệu có thể điền thông qua API певсокоти.
Get StartedCách Lấy Trường Form từ Tài liệu PDF sử dụng Cloud .NET SDK
Để lấy một AcroForm thông qua Cloud .NET SDK , chúng tôi sẽ sử dụng Aspose.PDF Cloud .NET SDK Cloud SDK này cho phép bạn dễ dàng xây dựng ứng dụng tạo, chỉnh sửa & chuyển đổi PDF dựa trên cloud bằng C#, ASP.NET hoặc ngôn ngữ .NET khác cho các nền tảng cloud khác nhau. Mở NuGet quản lý gói, tìm kiếm Aspose.PDF Cloud và cài đặt. Bạn cũng có thể sử dụng lệnh sau từ Console Quản lý gói.
Lệnh Console Quản lý gói
PM> Install-Package Aspose.Pdf-Cloud
Các bước để lấy AcroForms thông qua .NET SDK
Nhung̣ năng developers có thể dễ dàng tải và lấy acroforms trong PDF chỉắm vài dòng mã.
- Tạo một đối tượng Configuration mới với Application Secret và Key của bạn
- Tạo một đối tượng để kết nối với Cloud API
- Tải lên file tài liệu của bạn
- Thực hiện việc lấy
- Tải xuống kết quả
Mã mẫu này hiển thị việc lấy AcroForms trong các tài liệu PDF
public static void GetFormFields()
{
const string localImageFileName = @"C:\Samples\StudentInfoFormElectronic.pdf";
const string storageFileName = "StudentInfoFormElectronic.pdf";
// Get your AppSid and AppSecret from https://dashboard.aspose.cloud (free registration required).
var pdfApi = new PdfApi(AppSecret, AppSid);
if (pdfApi.GetFilesList("").Value.All(f => f.Name != storageFileName))
{
using var file = File.OpenRead(localImageFileName);
var uploadResult = pdfApi.UploadFile(storageFileName, file);
Console.WriteLine(uploadResult.Uploaded[0]);
}
var response = pdfApi.GetFields(storageFileName);
foreach (var item in response.Fields.List)
{
if (item.Type == FieldType.List)
{
Console.Write($"Name: [{item.Name}] Value:");
foreach (var listItem in item.Values)
{
Console.WriteLine($"{listItem} ");
}
}
else
{
Console.WriteLine($"Name: [{item.Name}] Value: [{item.Values.FirstOrDefault()}]");
}
}
}