diff --git a/components/fpspreadsheet/examples/other/crypto/pwd 123.xlsx b/components/fpspreadsheet/examples/other/crypto/pwd 123.xlsx new file mode 100644 index 000000000..832ab43e5 Binary files /dev/null and b/components/fpspreadsheet/examples/other/crypto/pwd 123.xlsx differ diff --git a/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpi b/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpi new file mode 100644 index 000000000..309ceda79 --- /dev/null +++ b/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpi @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <RequiredPackages> + <Item> + <PackageName Value="laz_fpspreadsheet_crypto"/> + </Item> + <Item> + <PackageName Value="laz_fpspreadsheet"/> + </Item> + </RequiredPackages> + <Units> + <Unit> + <Filename Value="read_encrypted_xlsx.lpr"/> + <IsPartOfProject Value="True"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="read_encrypted_xlsx"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + </Debugging> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions> + <Item> + <Name Value="EAbort"/> + </Item> + <Item> + <Name Value="ECodetoolError"/> + </Item> + <Item> + <Name Value="EFOpenError"/> + </Item> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpr b/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpr new file mode 100644 index 000000000..623fd1216 --- /dev/null +++ b/components/fpspreadsheet/examples/other/crypto/read_encrypted_xlsx.lpr @@ -0,0 +1,34 @@ +program read_encrypted_xlsx; + +uses + SysUtils, + fpSpreadsheet, fpsTypes, fpsUtils, xlsxOOXML_Crypto; + +const + FILENAME = 'pwd 123.xlsx'; + PASSWORD = '123'; + +var + wb: TsWorkbook; + ws: TsWorksheet; + cell: PCell; + t: TDateTime; +begin + t := Now; + wb := TsWorkbook.Create; + try + wb.ReadFromFile(FILENAME, sfidOOXML_Crypto, PASSWORD, []); + ws := wb.GetFirstWorksheet; + if ws <> nil then + for cell in ws.Cells do + WriteLn('cell ', GetCellString(cell^.Row, cell^.Col), ' = "', ws.ReadAsText(cell), '"'); + finally + wb.Free; + end; + t := Now - t; + WriteLn('Time to decrypt and load: ', FormatDateTime('nn:ss.zzz', t), ' seconds'); + WriteLn; + Write('Press ENTER to close...'); + ReadLn; +end. +