Created
April 10, 2012 16:41
-
-
Save peysal/2352732 to your computer and use it in GitHub Desktop.
Using adobe fdf to populate value inside pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.mbb.incr2; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
import com.adobe.fdf.FDFDoc; | |
import com.adobe.fdf.exceptions.FDFException; | |
public class UpdateSignature { | |
public static final String LOCATION = "C:/workspace/mbbForm/src/my/mbb/incr2/DP3_UpdateSignature_Form_v1.3.pdf"; | |
public static final URL RELATIVE_FDF_LOCATION = UpdateSignature.class.getClassLoader( | |
).getResource("my/mbb/documents/DP3_UpdateSignature_Form_v1.3_data.fdf"); | |
public static final URL RELATIVE_PDF_LOCATION = UpdateSignature.class.getClassLoader( | |
).getResource("my/mbb/documents/DP3_UpdateSignature_Form_v1.3.pdf"); | |
public static void main (String[] args) throws FileNotFoundException, URISyntaxException { | |
try { | |
FDFDoc outFDF = new FDFDoc(); | |
//outFDF.SetFile("C:/workspace/mbbForm/bin/my/mbb/documents/DP3_UpdateSignature_Form_v1.3.pdf"); | |
File pdfFile = new File(RELATIVE_PDF_LOCATION.toURI()); | |
outFDF.SetFile(pdfFile.getAbsolutePath()); | |
System.out.println("pdf location:" + pdfFile.getAbsolutePath()); | |
outFDF.SetValue("branchName", "sa"); | |
//File fdfFile = new File("C:/workspace/mbbForm/bin/my/mbb/documents/DP3_UpdateSignature_Form_v1.3_data.fdf"); | |
File fdfFile = new File(RELATIVE_FDF_LOCATION.toURI()); | |
System.out.println("fdfFile:" + fdfFile); | |
outFDF.Save(new FileOutputStream(fdfFile)); | |
} catch(FDFException e) { | |
e.printStackTrace(); | |
} | |
System.out.println("abis"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you still have those adobe libraries ( com.adobe.fdf.)