using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
public static class ReadPdfFunction
[FunctionName("ReadPdf")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
log.LogInformation("C# HTTP trigger function processed a request.");
string pdfUrl = req.Query["C:\Users\DELL\Downloads\Crane-Co_PSE_2022_2.27.23_FINAL.pdf"];
using (var webClient = new WebClient())
var pdfBytes = await webClient.DownloadDataTaskAsync(pdfUrl);
using (var pdfReader = new PdfReader(pdfBytes))
using (var pdfDocument = new PdfDocument(pdfReader))
string text = string.Empty;
for (int i = 1; i <= pdfDocument.GetNumberOfPages(); i++)
text += PdfTextExtractor.GetTextFromPage(pdfDocument.GetPage(i));
return new OkObjectResult(text);