diff --git a/Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md b/Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md index 992337550..7ecc8d85b 100644 --- a/Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md +++ b/Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md @@ -1608,7 +1608,10 @@ You can download a complete working sample from [GitHub](https://github.com/Sync Read a PDF document permission flags via the [Security.Permissions](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfSecurity.html#Syncfusion_Pdf_Security_PdfSecurity_Permissions) property, which returns a bitwise combination of values from the [PdfPermissionsFlags](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Security.PdfPermissionsFlags.html) enumeration. {% tabs %} -{% highlight c# tabtitle="C# [Cross-platform]" %} +{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/PDF-Examples/master/Security/PDF-permission-viewer/.NET/PDF-permission-viewer/Program.cs" %} + +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf.Security; // Load an existing PDF using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf")) @@ -1633,6 +1636,9 @@ using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf")) {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf.Security; + // Load an existing PDF using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf")) { @@ -1656,6 +1662,9 @@ using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf")) {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +Imports Syncfusion.Pdf.Parsing +Imports Syncfusion.Pdf.Security + ' Load an existing PDF Using loadedDocument As New PdfLoadedDocument("Input.pdf") ' Access the document security settings @@ -1678,7 +1687,7 @@ End Using {% endhighlight %} {% endtabs %} -You can download a complete working sample from GitHub. +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Security/PDF-permission-viewer/.NET). ## Remove password from the user password PDF document diff --git a/Document-Processing/PDF/PDF-Library/NET/Working-with-Text-Extraction.md b/Document-Processing/PDF/PDF-Library/NET/Working-with-Text-Extraction.md index 5f0638fb1..a4c7aa40c 100644 --- a/Document-Processing/PDF/PDF-Library/NET/Working-with-Text-Extraction.md +++ b/Document-Processing/PDF/PDF-Library/NET/Working-with-Text-Extraction.md @@ -651,4 +651,18 @@ You can download a complete working sample from [GitHub](https://github.com/Sync Finds a text string on a specific page (index), returning rectangles in matchRect. - \ No newline at end of file + + +## Troubleshooting and FAQ’s + +### What is the recommended way to extract form field values from a PDF document? + +The [ExtractText](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.PdfPageBase.html#Syncfusion_Pdf_PdfPageBase_ExtractText) API retrieves only the text that is visibly rendered on the page’s graphics layer. It does not extract the values contained in interactive form fields such as text boxes, combo boxes, or buttons. This is because form field data resides in the PDF’s interactive form (AcroForm) structure, separate from the page’s content stream. + +To retrieve form field values, you have two recommended options: + +1. [Flatten form fields](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/working-with-forms#flattening-form-fields-in-a-pdf): Converts interactive form fields into static page content, embedding their values directly into the PDF’s text stream. After flattening, any text extraction process (such as ExtractText) will include these values. + +Refer to the text extraction section of the PDF [UG documentation](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/working-with-text-extraction) for more details. + +2. [Iterate through form fields directly](https://help.syncfusion.com/document-processing/pdf/pdf-library/net/working-with-forms#enumerate-the-form-fields): Access each form field in the PDF’s form collection and read its value programmatically. This approach provides the most accurate and structured method for extracting form data. \ No newline at end of file