hai friends,
I want compress a PDF file of size 30.9MB to few 100KB, by using codes in C#.NET
Java
FileStream sourceFileStream = File.OpenRead(@"D:\CMS\newsample.pdf");
FileStream destFileStream = File.Create(@"D:\ newsample_new.pdf");
GZipStream compressingStream = new GZipStream(destFileStream, CompressionMode.Compress);
byte[] bytes = new byte[2800];
int bytesRead;
while ((bytesRead = sourceFileStream.Read(bytes, 0, bytes.Length)) != 0)
{
compressingStream.Write(bytes, 0, bytesRead);
}
sourceFileStream.Close();
compressingStream.Close();destFileStream.Close();
thanks in advance
oliver allardyce2 pointsPosted Sep 11, 2014, 4:20 AM EDT
However, if the source contains images (pictures) of text, it can be reduced significantly if you convert the images to actual text and save it without the original images.
To do the conversion from images to text, you will need to perform optical character recognition (OCR) using a good OCR engine such as Leadtools.