public class

XfdfUtils

extends Object
java.lang.Object
   ↳ com.pdftron.collab.utils.XfdfUtils

Class Overview

Utility class for XFDF

Summary

Constants
String XFDF_ADD
String XFDF_DELETE
String XFDF_END
String XFDF_MODIFY
String XFDF_START
Public Constructors
XfdfUtils()
Public Methods
static ArrayList<AnnotationEntity> convToAnnotations(String xfdfJSON, String documentId, String userName)
Converts JSON with annotation properties to list of AnnotationEntity
static Date deserializeDate(String dateStr)
Converts date string to java.util.Date
static void fillAnnotationEntity(String documentId, AnnotationEntity input)
Parse required fields for AnnotationEntity from its XFDF information
static boolean isValidInsertEntity(AnnotationEntity entity)
static AnnotationEntity parseAnnotationEntity(String documentId, JSONObject annotation)
Parse XFDF information from JSON into AnnotationEntity
static ReplyEntity parseReplyEntity(AnnotationEntity annotation)
Parse reply information from AnnotationEntity
static HashMap<String, AnnotationEntity> parseXfdf(String documentId, String xfdf)
Parses XFDF string into map of properties
static HashMap<String, AnnotationEntity> parseXfdfCommand(String documentId, String xfdfCommand)
static String prepareAnnotation(String action, ArrayList<AnnotationEntity> annotationEntities, String documentId, String userName)
static AnnotationEntity toAnnotationEntity(PDFDoc pdfDoc, String documentId, Annot annot)
static String validateXfdf(String xfdf)
Utility method to return a valid XFDF command string
static String wrapDeleteXfdf(String id)
Gets delete XFDF command
static AnnotationEntity xfdfToAnnotationEntity(String documentId, JSONObject annotation)
Creates AnnotationEntity from JSON that contains required information
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String XFDF_ADD

Constant Value: "add"

public static final String XFDF_DELETE

Constant Value: "delete"

public static final String XFDF_END

Constant Value: ""

public static final String XFDF_MODIFY

Constant Value: "modify"

public static final String XFDF_START

Constant Value: " "

Public Constructors

public XfdfUtils ()

Public Methods

public static ArrayList<AnnotationEntity> convToAnnotations (String xfdfJSON, String documentId, String userName)

Converts JSON with annotation properties to list of AnnotationEntity

Throws
JSONException

public static Date deserializeDate (String dateStr)

Converts date string to java.util.Date

public static void fillAnnotationEntity (String documentId, AnnotationEntity input)

Parse required fields for AnnotationEntity from its XFDF information

public static boolean isValidInsertEntity (AnnotationEntity entity)

public static AnnotationEntity parseAnnotationEntity (String documentId, JSONObject annotation)

Parse XFDF information from JSON into AnnotationEntity

public static ReplyEntity parseReplyEntity (AnnotationEntity annotation)

Parse reply information from AnnotationEntity

public static HashMap<String, AnnotationEntity> parseXfdf (String documentId, String xfdf)

Parses XFDF string into map of properties

public static HashMap<String, AnnotationEntity> parseXfdfCommand (String documentId, String xfdfCommand)

public static String prepareAnnotation (String action, ArrayList<AnnotationEntity> annotationEntities, String documentId, String userName)

Throws
JSONException

public static AnnotationEntity toAnnotationEntity (PDFDoc pdfDoc, String documentId, Annot annot)

Parameters
pdfDoc the PDF document
annot the annotation
Returns
  • the annotation entity

public static String validateXfdf (String xfdf)

Utility method to return a valid XFDF command string

public static String wrapDeleteXfdf (String id)

Gets delete XFDF command

public static AnnotationEntity xfdfToAnnotationEntity (String documentId, JSONObject annotation)

Creates AnnotationEntity from JSON that contains required information