Get Metadata from PDF documents via .NET SDK
API from extracting metadata from PDF docuemnts using Aspose.PDF Cloud SDK.
Get StartedHow to Get Metadata from PDF Documents using Cloud .NET SDK
In order to get a Metadata via Cloud .NET SDK , we’ll use
Aspose.PDF Cloud .NET SDK
This Cloud SDK allows you to easily build cloud-based PDF creator, editor & converter apps in C#, ASP.NET, or other .NET languages for various cloud platforms. Open
NuGet
package manager, search for
Aspose.PDF Cloud
and install. You may also use the following command from the Package Manager Console: PM> Install-Package Aspose.Pdf-Cloud
Steps to get Metadata via .NET SDK
Aspose.PDF Cloud developers can easily load & get metadata in PDF in just a few lines of code.
- Create a new Configuration object with your Application Secret and Key
- Create an object to connect to the Cloud API
- Upload your document file
- Get all properties using GetDocumentProperties
- Handle properties, for example, print to console
This sample code shows getting a Metadata from PDF documents
public static void GetMetadata()
{
const string localPdfFileName = @"C:\Samples\sample.pdf";
const string storageFileName = "sample.pdf";
const string localFolder = @"C:\Samples";
const string storageTempFolder = "YourTempFolder";
// Get your AppSid and AppSecret https://dashboard.aspose.cloud (free registration required).
var pdfApi = new PdfApi(AppSecret, AppSid);
if (pdfApi.GetFilesList(storageTempFolder).Value.All(f => f.Name != storageFileName))
{
using var file = File.OpenRead(localPdfFileName);
var uploadResult = pdfApi.UploadFile(Path.Combine(storageTempFolder, storageFileName), file);
Console.WriteLine(uploadResult.Uploaded[0]);
}
var response = pdfApi.GetDocumentProperties(storageFileName, folder: storageTempFolder);
foreach (var item in response.DocumentProperties.List)
Console.WriteLine($"Name: {item.Name} Value: {item.Value}");
}
- Learning Resources
- Documentation
- Source Code
- API References
- Product Support
- Free Support
- Paid Support
- Blog
- Why Aspose.PDF Cloud for .NET?
- Customers List
- Security