Images, Styles, Links, Comments, and Metadata
Inspect workbook objects beyond plain cell values and extract embedded media safely.
Updated
images()extractImages()cellDetails()sheetMetadata()protection()What you will learn
- Inventory workbook objects without loading unnecessary binary data.
- Extract media into a controlled directory.
- Read style and protection metadata from detailed cells.
List images without loading image bytes#
$sheet = MnbExcel::read('catalog.xlsx')->sheet('Products');
foreach ($sheet->images(includeBytes: false) as $image) {
printf("%s at %s\n", $image['filename'], $image['anchor']['from'] ?? '?');
}Extract images safely#
$files = MnbExcel::read('catalog.xlsx')
->sheet('Products')
->extractImages(__DIR__ . '/storage/extracted-images');Read metadata through a cell snapshot#
$cell = MnbExcel::read('review.xlsx')
->sheet('Review')
->cellDetails('B7');
print_r([
'style' => $cell->style,
'hyperlink' => $cell->hyperlink,
'comment' => $cell->comment,
'mergedRange' => $cell->mergedRange,
'richText' => $cell->richText,
'protection' => $cell->protection,
]);Inspect worksheet-level metadata#
$sheet = MnbExcel::read('report.xlsx')->sheet('Summary');
print_r($sheet->sheetMetadata());
print_r($sheet->protection());Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue