MCPcopy Create free account
hub / github.com/apache/pdfbox / call

Method call

tools/src/main/java/org/apache/pdfbox/tools/ExportFDF.java:75–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 public Integer call()
76 {
77 try (PDDocument pdf = Loader.loadPDF(infile))
78 {
79 PDAcroForm form = pdf.getDocumentCatalog().getAcroForm();
80 if( form == null )
81 {
82 SYSERR.println( "Error: This PDF does not contain a form." );
83 return 1;
84 }
85 else
86 {
87 if (outfile == null)
88 {
89 String outPath = FilenameUtils.removeExtension(infile.getAbsolutePath()) + ".fdf";
90 outfile = new File(outPath);
91 }
92 try (FDFDocument fdf = form.exportFDF())
93 {
94 fdf.save( outfile );
95 }
96 }
97 }
98 catch (IOException ioe)
99 {
100 SYSERR.println( "Error exporting FDF data [" + ioe.getClass().getSimpleName() + "]: " + ioe.getMessage());
101 return 4;
102 }
103 return 0;
104 }
105}

Callers

nothing calls this directly

Calls 5

loadPDFMethod · 0.95
exportFDFMethod · 0.95
getDocumentCatalogMethod · 0.80
getAcroFormMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected