Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Document-Processing/PDF/PDF-Library/NET/Working-with-Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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"))
{
Expand All @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,18 @@ You can download a complete working sample from [GitHub](https://github.com/Sync
<td>Finds a text string on a specific page (<code>index</code>), returning rectangles in <code>matchRect</code>.</td>
</tr>
</tbody>
</table>
</table>

## 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.