pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Nygaard" <pnyga...@ritehite.com>
Subject Fw: java error: nullpointerexception
Date Thu, 23 Oct 2014 18:36:39 GMT
I am trying to use an FDF file to populate a PDF template document using 
PDFbox.  I am hoping you can help with an error I am encountering.  I 
believe at the line "PDDocumentCatalog docCatalog = pd
the nullpointerexception is occuring.

The console shows that the FDF file is loaded, however the next println 
statment "1" nevers appears,  the nullpointerexception occurs.

Read FDF file: c:\files\CYLeveler-DLIGCAP.FDF
FDF file loaded
Exception in thread "AgentThread: JavaAgent" 
        at JavaAgent.NotesMain(Unknown Source)
        at lotus.domino.AgentBase.runNotes(Unknown Source)
        at lotus.domino.NotesThread.run(Unknown Source)

public class JavaAgent extends AgentBase {
        PDDocument pd;
        FDFDocument fdf; 
        PDDocumentCatalog docCatalog;
public void NotesMain() {
        System.out.println("Read FDF file: " + flds[1]);
                File input = new File(flds[1]);
                fdf = FDFDocument.load(input); 
                System.out.println("FDF file loaded"); 
                PDDocumentCatalog docCatalog = pd.getDocumentCatalog(); // 
I think this is where the nullpointerexception occurs.
                System.out.println("   1");
                PDAcroForm acroForm = docCatalog.getAcroForm();
                System.out.println("   2");
                acroForm.setCacheFields( true ); 
                System.out.println("   3");
                System.out.println("   4");

thank you for any assistance you can provide.

Pete Nygaard
Sr, Programmer/Analyst

CONFIDENTIALITY NOTICE: This message is from Rite-Hite Holding Corporation and may contain
confidential and proprietary information that is intended only for the individual(s) or entities
named. If you have received this message in error, please let us know immediately by e-mail
reply and delete it from your system. You may not copy this message or disclose its contents
to anyone. Rite-Hite reserves the right to monitor messages by authorized Rite-Hite employees
at anytime and without further consent.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message