Visual interaction with annotations and form fields of PDF document.

Articles about functionality of VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Visual interaction with annotations and form fields of PDF document.

Post by Alex » Fri Oct 14, 2016 10:42 am

Starting from version 8.4 of VintaSoft Imaging .NET SDK has been offered new functional edition of VintaSoft PDF .NET Plug-in - "PDF Visual Editor". Edition includes new visual tool - PdfAnnotationTool, which can work directly with PDF annotations and ensures the compatibility of created PDF annotations with all PDF viewing applications.

This article shows how PdfEditorDemo application uses PdfAnnotationTool.



Creating and changing of PDF annotations visually in PdfEditorDemo.
PdfEditorDemo allows to:
  • Annotate new or existing PDF document.
    Image
  • Copy, edit or remove PDF annotations. Copy PDF annotations from one PDF document to another.
    Image
  • Assign the action when mouse is clicked on the Link-annotation:
    Image
  • Edit all PDF annotation properties, which are responsible to the behaviour and visual appearance of annotation:
    Image


Filling, creating and editing of PDF interactive form fields visually in PdfReaderDemo.
PdfEditorDemo allows to:
  • Execute JavaScript actions. Executing of JavaScript actions provides the ability to fill in complicated forms with calculated fields and allows to add an additional interactivity to the process of filling the form of PDF document.
  • Fill all field types using both mouse or keyboard:
    Image
  • Create, copy or delete fields tree in a PDF document. Copy fields tree from one PDF document to another.
    Image
  • View, add, remove and edit the trigger actions of any interactive fields:
    Image
    Image
  • Edit all PDF field properties, which are responsible to the behaviour and visual appearance of annotation:
    Image
    Image


Using different interaction modes in PdfEditorDemo.
View mode is intended for viewing PDF document and filling PDF interactive fields.
Markup mode is intended for annotating PDF document and filling PDF interactive fields.
In View and Edit modes:
  • All triggers are performed.
  • PDF interactive fields, which must be filled, can be highlighted.
    PDF interactive fields, which are obligatory for filling, can have special highlighting (red border in demo).
    Image

Edit mode is intended for editing PDF-annotations and structure of PDF interactive form.
In Edit mode:
  • Triggers are not executed.
  • All (visible and invisible) PDF annotations and PDF interactive fields are visible and may be highlighted using the adjustable highlighting:
    Image
  • Multiple PDF-annotations and PDF interactive fields can be relocated, copied or removed:
    Image
  • Field names can be displayed over PDF interactive fields for simplifying the navigation process:
    Image


Using the barcode fields in PdfEditorDemo.
PdfEditorDemo allows to create and edit barcode fields, according with PDF 1.7 ExtensionLevel 3, of PDF interactive form
and uses VintaSoft Barcode .NET SDK for generating the barcodes.

There are allowable three barcode types: QR Code, DataMatrix, PDF417
Image

The barcode value can be computed dynamically using JavaScript code (for example, barcode may contain all form values divided by the sign '|' and may be changed when any field is changed):
Image



Performing of JavaScript code in PdfEditorDemo.
For testing the execution of JavaScript actions in PDF let's create a PDF document, which contains a simple "calculator".

First, we need create new PDF document, which contains a single page.
Next, we need add 5 interactive fields to a PDF page.
Next, we need define a JavaScript action for the Calculate trigger of the "Result" field:

Code: Select all

var left = this.getField('Left');
var right = this.getField('Right');
var result = this.getField('Result');
var operator = this.getField('Operator').value;
switch (operator)
{
  case "+": result.value = left.value + right.value; break;
  case "-": result.value = left.value - right.value; break;
  case "/": result.value = left.value / right.value; break;
  case "*": result.value = left.value * right.value; break;
}
Image

Finally, we need add the "Result" field to the list of calculated fields:
Image

The resulting PDF document with calculator is ready and can be tested! :-)



Debugging of JavaScript code in PdfEditorDemo.
The PdfEditorDemo menu "View -> JavaScript -> Debugger" allows to open form for debugging of JavaScript code:
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest