7zip - How to compress PDF file using sevenzipsharper in c#? -
i can compress directory using 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 want compress single pdf file. how can compress single pdf file?
use sevenzipcompressor.compressfiles
method instead of sevenzipcompressor.compressdirectory
.
please try find out basics (like this) yourself. supposed work on own before asking here.
Comments
Post a Comment