use of com.tom_roush.pdfbox.pdmodel.common.filespecification.PDFileSpecification in project PdfBox-Android by TomRoush.
the class FDFDictionary method writeXML.
/**
* This will write this element as an XML document.
*
* @param output The stream to write the xml to.
*
* @throws IOException If there is an error writing the XML.
*/
public void writeXML(Writer output) throws IOException {
PDFileSpecification fs = this.getFile();
if (fs != null) {
output.write("<f href=\"" + fs.getFile() + "\" />\n");
}
COSArray ids = this.getID();
if (ids != null) {
COSString original = (COSString) ids.getObject(0);
COSString modified = (COSString) ids.getObject(1);
output.write("<ids original=\"" + original.toHexString() + "\" ");
output.write("modified=\"" + modified.toHexString() + "\" />\n");
}
List<FDFField> fields = getFields();
if (fields != null && fields.size() > 0) {
output.write("<fields>\n");
for (FDFField field : fields) {
field.writeXML(output);
}
output.write("</fields>\n");
}
}
use of com.tom_roush.pdfbox.pdmodel.common.filespecification.PDFileSpecification in project PdfBox-Android by TomRoush.
the class FDFDictionary method getEmbeddedFDFs.
/**
* This will get the list of embedded FDF entries, or null if the entry is null. This will return a list of
* PDFileSpecification objects.
*
* @return A list of embedded FDF files.
*
* @throws IOException If there is an error creating the file spec.
*/
public List<PDFileSpecification> getEmbeddedFDFs() throws IOException {
List<PDFileSpecification> retval = null;
COSArray embeddedArray = (COSArray) fdf.getDictionaryObject(COSName.EMBEDDED_FDFS);
if (embeddedArray != null) {
List<PDFileSpecification> embedded = new ArrayList<PDFileSpecification>();
for (int i = 0; i < embeddedArray.size(); i++) {
embedded.add(PDFileSpecification.createFS(embeddedArray.get(i)));
}
retval = new COSArrayList<PDFileSpecification>(embedded, embeddedArray);
}
return retval;
}
Aggregations