use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.
the class PDComplexFileSpecification method setEmbeddedFileDos.
/**
* Set the embedded dos file for this spec.
*
* @param file The dos file to be embedded.
* @deprecated This method is obsolescent and should not be used by conforming writers.
*/
@Deprecated
public void setEmbeddedFileDos(PDEmbeddedFile file) {
COSDictionary ef = getEFDictionary();
if (ef == null && file != null) {
ef = new COSDictionary();
fs.setItem(COSName.EF, ef);
}
if (ef != null) {
ef.setItem(COSName.DOS, file);
}
}
use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.
the class PDNumberTreeNode method getKids.
/**
* Return the children of this node. This list will contain PDNumberTreeNode objects.
*
* @return The list of children or null if there are no children.
*/
public List<PDNumberTreeNode> getKids() {
List<PDNumberTreeNode> retval = null;
COSArray kids = (COSArray) node.getDictionaryObject(COSName.KIDS);
if (kids != null) {
List<PDNumberTreeNode> pdObjects = new ArrayList<PDNumberTreeNode>();
for (int i = 0; i < kids.size(); i++) {
pdObjects.add(createChildNode((COSDictionary) kids.getObject(i)));
}
retval = new COSArrayList<PDNumberTreeNode>(pdObjects, kids);
}
return retval;
}
use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.
the class PDPage method getViewports.
/**
* Get the viewports.
*
* @return a list of viewports or null if there is no /VP entry.
*/
public List<PDViewportDictionary> getViewports() {
COSBase base = page.getDictionaryObject(COSName.VP);
if (!(base instanceof COSArray)) {
return null;
}
COSArray array = (COSArray) base;
List<PDViewportDictionary> viewports = new ArrayList<PDViewportDictionary>();
for (int i = 0; i < array.size(); ++i) {
COSBase base2 = array.getObject(i);
if (base2 instanceof COSDictionary) {
viewports.add(new PDViewportDictionary((COSDictionary) base2));
} else {
Log.w("PdfBox-Android", "Array element " + base2 + " is skipped, must be a (viewport) dictionary");
}
}
return viewports;
}
use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.
the class PDPage method getThreadBeads.
/**
* This will get a list of PDThreadBead objects, which are article threads in the document. This
* will return an empty list if there are no thread beads.
*
* @return A list of article threads on this page, never null. The returned list is backed by
* the beads COSArray, so any adding or deleting in this list will change the document too.
*/
public List<PDThreadBead> getThreadBeads() {
COSArray beads = (COSArray) page.getDictionaryObject(COSName.B);
if (beads == null) {
beads = new COSArray();
}
List<PDThreadBead> pdObjects = new ArrayList<PDThreadBead>();
for (int i = 0; i < beads.size(); i++) {
COSBase base = beads.getObject(i);
PDThreadBead bead = null;
// in some cases the bead is null
if (base instanceof COSDictionary) {
bead = new PDThreadBead((COSDictionary) base);
}
pdObjects.add(bead);
}
return new COSArrayList<PDThreadBead>(pdObjects, beads);
}
use of com.tom_roush.pdfbox.cos.COSDictionary in project PdfBox-Android by TomRoush.
the class PDDocumentCatalog method getDests.
/**
* @return The named destinations dictionary for this document or null if none exists.
*/
public PDDocumentNameDestinationDictionary getDests() {
PDDocumentNameDestinationDictionary nameDic = null;
COSDictionary dests = (COSDictionary) root.getDictionaryObject(COSName.DESTS);
if (dests != null) {
nameDic = new PDDocumentNameDestinationDictionary(dests);
}
return nameDic;
}
Aggregations