Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require_once dirname(__FILE__) . '/PHPExcel_1.8/Classes/PHPExcel/IOFactory.php';
- if(!file_exists("oferta.xlsx")) {
- exit("Nie mozna otworzyc pliku");
- }
- $inputType = "oferta.xlsx";
- $excelReader = PHPExcel_IOFactory::createReaderForFile($inputType);
- $excelObj = $excelReader->load($inputType);
- $getHighestRow = $excelObj->getActiveSheet()->getHighestRow();
- for($i = 0; $i < $getHighestRow/2; $i++ ){
- foreach ($excelObj->getActiveSheet()->getDrawingCollection() as $drawing) {
- if ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) {
- ob_start();
- call_user_func(
- $drawing->getRenderingFunction(),
- $drawing->getImageResource()
- );
- $imageContents = ob_get_contents();
- ob_end_clean();
- $cellID = $drawing->getCoordinates();
- }
- $filename = $drawing->getPath();
- $drawing->getImageIndex();
- echo '<br>';
- $i+=1;
- copy($filename, 'Image'.$i);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement