The namespace TXTextControl.DocumentServer.PDF provides access to PDF elements and can be used to extract form data from completed PDF forms.

The following JSON contains all form fields of the PDF document on the right. The data is extracted server-side without any UI.

הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This demo uses the MVC version of TXTextControl.Web.MVC.DocumentViewer included in TX Text Control .NET Server for ASP.NET. The functionality is compatible across all supported platforms.

Version 33.0

<div class="row">
<div class="col-4">
<!-- Info area -->
<div class="alert alert-info mt-3" role="alert">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span class="alert-text"></span>
</div>
<button onclick="Extract()" class="btn mt-3 btn-success">Extract Data</button>
<p class="mt-5">Extracted Form Fields</p>
<div id="jsonEditor"></div>
</div>
<div class="col-8">
<div class="tx-container">
@Html.TXTextControl().DocumentViewer(settings => {
settings.DocumentPath = Server.MapPath("~/App_Data/Documents/vendor_completed.tx");
settings.Dock = DocumentViewerSettings.DockStyle.Fill;
settings.IsSelectionActivated = false;
settings.ShowThumbnailPane = false;
}).Render()
</div>
</div>
</div>
view raw test.cshtml hosted with ❤ by GitHub
[HttpGet]
public string PDFExtractData() {
string output = "";
// create temporary ServerTextControl
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
TXTextControl.DocumentServer.PDF.AcroForms.FormField[] acroForms =
Forms.GetAcroFormFields(Server.MapPath("~/App_Data/Documents/vendor_completed.pdf"));
output = JsonConvert.SerializeObject(acroForms);
}
// return as Base64 encoded string
return output;
}
view raw test.cs hosted with ❤ by GitHub
function Extract(download) {
$('.alert .alert-text').text("Extracting form data. Please wait...");
$('.alert').show();
var bDocument;
var serviceURL = "@Url.Action("PDFExtractData", "TX")";
// send document to controller
$.ajax({
type: "GET",
url: serviceURL,
success: successFunc,
error: errorFunc
});
function successFunc(data, status) {
editor.setValue(JSON.stringify(JSON.parse(data), null, 2));
$('.alert').hide();
}
function errorFunc() {
alert("Error");
}
}
view raw test.js hosted with ❤ by GitHub

No code required.

Next Sample

© 2025 Copyright Text Control GmbH and Text Control, LLC. All rights reserved. We documents.