I can compress a directory using the following code:
string dll = @"D:\7z.dll";
string source = @"D:\sample";
string output = @"D:\My7zipped.7z";
SevenZipBase.SetLibraryPath(dll);
SevenZipCompressor compressor = new SevenZipCompressor();
compressor.ZipEncryptionMethod = ZipEncryptionMethod.Aes256;
compressor.CompressionMethod = CompressionMethod.Lzma2;
compressor.CompressionLevel = CompressionLevel.Normal;
compressor.CompressDirectory(source, output);
But i want to compress into a single PDF file. How can I compress into a single PDF file?
Use the
SevenZipCompressor.CompressFilesmethod instead ofSevenZipCompressor.CompressDirectory.Please try to find out the basics (like this) yourself. You are supposed to do some work on your own before asking here.