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

Method call

tools/src/main/java/org/apache/pdfbox/tools/ExportXFDF.java:76–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected