August 10, 2019 posted by

I have some very large PDF files that are being created using C# and ItextSharp. One of the biggest files gets very close to the 10GB limit on file. iText will never compress an XMP metadata stream; all other content streams are compressed by default. You’ve already used the setCompressionLevel(). I want to compress a PDF file size from MB’s to KB’s (if the file size is 5 MB then it should be compressed in to KB’s like KB or KB).

Author: Nakora Shaktijin
Country: India
Language: English (Spanish)
Genre: Relationship
Published (Last): 26 February 2006
Pages: 221
PDF File Size: 13.18 Mb
ePub File Size: 19.25 Mb
ISBN: 348-7-93127-156-1
Downloads: 37417
Price: Free* [*Free Regsitration Required]
Uploader: Douzuru

Reduce PDF file size

See above I owe you one. Compression to compress or zip one of those to a smaller size. It’s been a while and I don’t remember the exact details, but there where methods similar to.

In iText you got several options: As you can see, compressing as many objects as possible is the most effective option in this example, but be aware that the compression percentage largely depends on the type of content in the document. This can be handy when you need to debug a PDF document. It uses open source programs including iTextSharp to perform the tasks you need.

When answering a question please: I haven’t used ITextSharp compression but I doubt that. It is updated on a regular basis, depending on how many new questions appear on StackOverflow.


C# and itextsharp PDF compression – CodeProject

You should do one of these too. Leonard, didn’t know at first what you meant with “refrying” but found this article of yours which explains it quite well: All of the above won’t help you much, because good PDF creators already compress whatever can be compressed. I am guessing you want to reduce the size of Pdfs which mostly or only contain images e. Request-for-help posts should be made with effort Rule 5: Pdf enterprise library, and it worked great.

Format “Original file size: Again, thank you everyone!!! If you find any error, please report it then we will take actions to correct it as soon as possible. What information in those PDFs is superfluous in your context and can be thrown away? I’ll update when I have more data. In iTextSharp, you can use the CompressionLevel property of the PdfWriter class to set the compression level of stream objects that are written to the FileStream.

However you may be able to use System. J-man 3 Note that developers post answers on StackOverflow on a voluntary basis; there’s no guaranteed response-time and responding to this free forum has low priority compared to delivering commercial support.

The CompressionLevel is actually what you normally think of as compression, a number from 0 to 9 or -1 to mean default which currently equals six I think. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject ifextsharp these policies.

  AG - AC160 PDF

Reduce image

Free Support If you have a technical question, and want an answer for free, you can post questions to: Some pdfs do not contain any images, nor any unused objects – size reduction is not possible in that case even if the pdf is MB. C and itextsharp PDF compressioh. I’m reading versions before 5 are free but not recommended due to possible bugs and no support. Submit a new text post.

compress pdf file with itextsharp

How can I achieve this using iTextSharp in C. It still works but it is very close to the upper limit. ITextSharp allows you to navigate over PDF pages and edit objects inside it along with many other features. NET library you can use in your programs to ocr and compress existing PDF files or create new ones from scanned images.