static void Main(string[] args) { Console.WriteLine("Hello World!"); try { IronPdf.License.LicenseKey = "IRONPDF.DEVTEAM.IX3145-C34E80DCB2-ADJHRCSXUKPB-PKEVGHAWERN4-QR764J6FKUVF-C2SF2RA7BMOA-YFAVLMKNDRC5-7BDQGJ-LL4ZT5GOFJ2NEA-MINISTRYOFBUSINESS.IRO200810.4403.75155.ORG.5DEV.4YR-Q4SJ5M.RENEW.SUPPORT.10.AUG.2024"; var pdf = new IronPdf.PdfDocument("response.pdf"); int permissions = EncryptionConstants.ALLOW_SCREENREADERS; using (ByteArrayOutputStream memoryStream = new ByteArrayOutputStream(pdf.BinaryData.Length)) { using (MemoryStream inputStream = new MemoryStream(pdf.BinaryData)) { iText.Kernel.Pdf.PdfDocument pdfDocument1 = new iText.Kernel.Pdf.PdfDocument(new PdfReader(inputStream), new PdfWriter(memoryStream)); pdfDocument1.Close(); } } } catch (Exception es) { var ass = es.Message; } }
public string ExtractTextFromPdf(Stream fileStream) { var doc = new IronPdf.PdfDocument(fileStream); var text = doc.ExtractAllText(); return(text); }
private void SaveToPDF(IronPdf.PdfDocument doc) { SaveFileDialog saveFileDialog = new SaveFileDialog(); if (saveFileDialog.ShowDialog() == true) { doc.SaveAs(saveFileDialog.FileName); } }
static void Main(string[] args) { ServiceCollection serviceCollection = new ServiceCollection(); ConfigureServices(serviceCollection); Console.WriteLine("Hello World!"); IronPdf.License.LicenseKey = "IRONPDF-1074125E7B-505437-994C4A-D829DFF424-4ED57CA5-UExA3EA6298E88F7D8-COMMUNITY.TRIAL.EXPIRES.15.MAY.2020"; var documentBody = configuration["document:documentBody"]; var bytes = Convert.FromBase64String(documentBody); var pdf = new IronPdf.PdfDocument(bytes, "12345", "123"); pdf.SecuritySettings.AllowUserAnnotations = false; pdf.SecuritySettings.AllowUserCopyPasteContent = false; pdf.SecuritySettings.AllowUserPrinting = IronPdf.PdfDocument.PdfSecuritySettings.PdfPrintSecrity.NoPrint; pdf.OwnerPassword = "******"; pdf.SaveAs("sample.pdf"); }
private static string ReadPDF(string fullPath) { var document = new IronPdf.PdfDocument(fullPath); return(document.ExtractAllText()); }