Personal tools
You are here: Home / OSCAR Users / EMR and Case Management Resources / eForms / eForms in development/beta testing / Useful Code / Patient demographic intake / Extracting data from the Patient demograpich intake pdf file using Java
Navigation
 

Extracting data from the Patient demograpich intake pdf file using Java

From Darius Opensource - With iText, it is relatively trivial to extract filled-in data from PDF forms. - Instructions - Download itext-5.5.3.zip and extract itextpdf-5.5.3.jar to the desktop. Download PDFDataExtract.java to the desktop. Compile PDFDataExtract.java using the following command: javac -cp itextpdf-5.5.3.jar PDFDataExtract.java Fill in the fields of Dr. Sedergreen's "Patient Demographic Data Fillable.pdf" and save it. To extract data from the filled-in "Patient Demographic Data Fillable.pdf" to extract.txt, use the following command: On Windows: java -cp itextpdf-5.5.3.jar;. PDFDataExtract "Patient Demographic Data Fillable.pdf">extract.txt On Ubuntu: java -cp itextpdf-5.5.3.jar:. PDFDataExtract "Patient Demographic Data Fillable.pdf">extract.txt As a quick hack, PDFDataExtract.java could be rewritten as a .jsp for use on OSCAR server. Darius.

Java source code icon PDFDataExtract.java — Java source code, 422 bytes

File contents

import java.util.*;
import com.itextpdf.text.pdf.*;
public class PDFDataExtract
{
public static void main(String[] args) throws Exception
{
   AcroFields fields=(new PdfReader(args[0])).getAcroFields();
   List<String>fieldNameList=new ArrayList(fields.getFields().keySet());Collections.sort(fieldNameList);
   for(String fieldName:fieldNameList)System.out.println(fieldName+":"+fields.getField(fieldName));
}
}

Document Actions

 

Download button

DOWNLOAD OSCAR FOR TESTING

 

eForms button

DOWNLOAD SHARED E-FORMS


 Customize button

FIND PLUG-INS AND TWEAKS
FOR YOUR OSCAR EMR

 

Subscribe Button

SUBSCRIBE TO DISCUSSION LIST 
(SEE ALL LISTS)

  

Help button

ACCESS THE ONLINE MANUALS
(PAID SUPPORT)