ImageEn, unit iexSevenZip

SevenZip PlugIn


SevenZip is an open source library that ImageEn uses to read archive files.
The following archive formats are supported: Zip, ZipX, EPub, 7z, BZip2, Cab, Rar, Tar, ISO, CHM and LZH.

When the SevenZip plug-in is installed:
TImageEnView can load images from archive files and navigate the content of archive files (e.g. using onscreen Buttons)
TImageEnMView can load and display the content of archive files
TImageEnFolderMView can browse the content of archive files
TIEFolderTree can display the folder tree within a archive file

The following features are supported:
256bit AES and other encrypted zip files (with automatic password prompt)
Zip folders (or optional flat file display)
Extraction of all or individual zip files
Dynamic loading of thumbnails



Notes
The SevenZip plug-in requires you to ship ie7zip32.dll (for 32bit applications) or ie7zip64.dll (for 64bit applications). These files are included in the \DLL\Zip\ folder of the ImageEn installation
The plug-in must be registered once by your application
Distributions must include the copyright notices that are included with the ImageEn SevenZip installation
Archive files must have a supported extension: *.zip, *.zipx, *.epub, *.7z, *.bzip2, *.bz2, *.gzip, *.cab, *.rar, *.tar, *.iso, *.chm, *.lzh


Demos

Demo  Demos\Other\ZipBrowser\ZipBrowser.dpr
Demo  Demos\Multi\FolderMView\FolderMView.dpr


Examples

// Register the SevenZip Plug-In
IEGlobalSettings().RegisterPlugIns([ iepiSevenZip ]);

// Load the first file in a zip and show buttons to allow navigation
ImageEnView1.ShowButtons := [ iebtPrevious, iebtNext ];
ImageEnView1.IO.LoadFromFileZIP( 'C:\Test.zip', 0 );

// Extract all files from a zip file to D:\Out\ (Recreating the internal zip folder structure)
ImageEnView1.IO.ExtractFromFileZIP( 'C:\test.zip', -1, 'D:\Out\', True );

// Display all files within a zip (ignoring the internal folder structure)
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip' );

// Display files within the root folder of the zip
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip', '\' );

// Display files within the zip folder \Holidays\Italy\
ImageEnMView1.FillFromZIP( 'C:\Files\Images.zip', '\Holidays\Italy\' );

// Output all images in a ZIP file to PNG
filename := 'C:\doc.ZIP';
outputFolder := 'D:\';
bmp := TIEBitmap.Create;
bmp.ParamsEnabled := True;
idx := 0;
Repeat
  bmp.Params.ImageIndex := idx;
  if bmp.LoadFromFile( filename ) then
    bmp.SaveToFile( IncludeTrailingBackSlash( outputFolder ) + format( '%s_%d.png', [ ExtractFilename( filename ), idx+1 ] ));
  inc( idx );
Until idx > bmp.Params.ImageCount - 1;
bmp.Free;


See Also

LoadFromFileZIP
ExtractFromFileZIP
LoadFromFileZIP
ExtractFromFileZIP
#ZIP Tags
ImageEn DLLs