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 20:04:54 GMT
my pd object was null, as I was loading the FDF file first and the program 
did not know about the PDF file yet.
so the null error is resolved.   My acroform is not populating yet, but 
the error is gone.

Pete Nygaard
Sr, Programmer/Analyst
Rite Hite Holding Corporation
8900 N Arbon Drive
Milwaukee, WI 53223
office: 414.362.4493
e-mail: pnygaard@ritehite.com
http://www.ritehite.com
----- Forwarded by Pete Nygaard/Brown Deer/Corp/Rite-Hite on 10/23/2014 
03:04 PM -----

From:   Pete Nygaard/Brown Deer/Corp/Rite-Hite
To:     users@pdfbox.apache.org, 
Date:   10/23/2014 01:36 PM
Subject:        Fw: java error: nullpointerexception


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
.getDocumentCatalog();"
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" 
java.lang.NullPointerException
        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");
                acroForm.importFDF(fdf); 
                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.

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