示例#1
0
 public function testStaticDocument()
 {
     try {
         Document::getDocument(__FILE__);
     } catch (\Exception $E) {
         $this->assertInstanceOf('MOC\\V\\Component\\Document\\Exception\\DocumentTypeException', $E);
     }
     try {
         Document::getDocument('Missing.pdf');
     } catch (\Exception $E) {
     }
     try {
         Document::getDocument('Missing.xls');
     } catch (\Exception $E) {
     }
     try {
         Document::getDocument('Missing.xlsx');
     } catch (\Exception $E) {
     }
     try {
         Document::getDocument('Missing.csv');
     } catch (\Exception $E) {
     }
 }
 /**
  * @param string $Location
  *
  * @return IBridgeInterface
  */
 public static function getPdfCreator($Location)
 {
     $Document = new Document(new Vendor(new MPdf()));
     if (file_exists(new FileParameter($Location))) {
         $Document->getBridgeInterface()->loadFile(new FileParameter($Location));
     }
     return $Document->getBridgeInterface();
 }