Home > Software engineering >  What is the `level` argument in zlib Deflate?
What is the `level` argument in zlib Deflate?

Time:01-11

I am trying to parse a PDF in C and I am using the zlib library for deflating. In the documentation, the zlibInit function takes an argument which is labeled as level. What is the purpose of that argument and how can I obtain it from the PDF stream?

CodePudding user response:

If there is a level argument, then you are using the wrong function to aid in parsing a PDF. level is only used for compression. For the PDF you need decompression. Compression in zlib is called "deflate". Decompression in zlib is called "inflate". You want to inflate, not deflate.

  • Related