+ function toBase64()
+ {
+ if(!preg_match('/^image\//', $this->mimetype)){
+ return false;
+ }
+
+ $file = $this->getStoreName();
+
+ if(!file_exists($file)){
+ return false;
+ }
+
+ $data = file_get_contents($file);
+
+ $base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);
+
+ return $base64;
+ }
+
+ function getNumberOfPages()
+ {
+ $ret = false;
+
+ switch ($this->mimetype) {
+ case 'application/pdf' :
+
+ $file = $this->getStoreName();
+
+ if(!file_exists($file)){
+ return false;
+ }
+
+ break;
+ default :
+ break;
+ }
+
+ return $ret;
+ }
+