1 31 package org.pdfbox.pdmodel.graphics.xobject; 32 33 import org.pdfbox.cos.COSDictionary; 34 import org.pdfbox.cos.COSName; 35 import org.pdfbox.cos.COSStream; 36 37 import org.pdfbox.pdmodel.PDResources; 38 import org.pdfbox.pdmodel.common.PDStream; 39 40 46 public class PDXObjectForm extends PDXObject 47 { 48 51 public static final String SUB_TYPE = "Form"; 52 53 58 public PDXObjectForm(PDStream formStream) 59 { 60 super( formStream ); 61 } 62 63 68 public PDXObjectForm(COSStream formStream) 69 { 70 super( formStream ); 71 } 72 73 78 public int getFormType() 79 { 80 return getCOSStream().getInt( "FormType",1 ); 81 } 82 83 88 public void setFormType( int formType ) 89 { 90 getCOSStream().setInt( "FormType", formType ); 91 } 92 93 100 public PDResources getResources() 101 { 102 PDResources retval = null; 103 COSDictionary resources = (COSDictionary)getCOSStream().getDictionaryObject( COSName.RESOURCES ); 104 if( resources != null ) 105 { 106 retval = new PDResources( resources ); 107 } 108 return retval; 109 } 110 111 116 public void setResources( PDResources resources ) 117 { 118 getCOSStream().setItem( COSName.RESOURCES, resources ); 119 } 120 } 121 | Popular Tags |