How to remove text from PDF document via Cloud .NET SDK
In order to extract text from PDF document 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.
Package Manager Console Command
PM> Install-Package Aspose.Pdf-Cloud
Steps to get text from PDF document via .NET SDK
Aspose.PDF Cloud developers can easily load & extract text from PDF in just a few lines of code.
- Upload the File to Cloud Storage
- Initializes the PdfApi with the provided credentials (Application ID and Application Key).
- Reads the local PDF file and uploads it to the Aspose Cloud storage.
- Call API to Extract text from PDF.
- Show extracted text from PDF.
This sample code shows deleting text from PDF documents
public static async Task Extract()
{
const string localImageFileName = @"C:\Samples\sample.pdf";
const string storageFileName = "sample.pdf";
const string storageTempFolder = "YourTempFolder";
// Get your AppSid and AppSecret from https://dashboard.aspose.cloud (free registration required).
//var pdfApi = new PdfApi(AppSecret, AppSid);
using var file = File.OpenRead(localImageFileName);
var uploadResult = await pdfApi.UploadFileAsync(storageFileName, file);
Console.WriteLine(uploadResult.Uploaded[0]);
var response = await pdfApi.GetTextAsync(storageFileName, LLX: 0, LLY: 0, URX: 0, URY: 0, folder: storageTempFolder);
foreach (var item in response.TextOccurrences.List)
{
Console.WriteLine($"Page <{item.Page}> : {item.Text}");
}
}
Extract Text from PDF
Text can be dynamically extracted ifromn PDF document for a specific user. Text extracted can help maintain consistent information across different PDF versions, avoiding manual edits and ensuring that key information remains in place. Extract Text from PDF documents with Aspose.PDF Cloud .NET SDK.
With our .NET library you can:
- Combine PDF documents.
- Split PDF Files.
- Convert PDF to other formats, and vice versa.
- Manipulate Annotations.
- Work with Images in PDF, etc.
- You can try out our free App to replace text in PDF files online and test the functionality.