nl_tokens: / * @see http : // www . w3 . org / TR / PNG - Chunks . html
pl_tokens: function compressBytes ( bytes , lineLength , colorsPerPixel , compression ) { var level = 5 , filter_method = filterUp ; switch ( compression ) { case jsPDFAPI . image_compression . FAST : level = 3 ; filter_method = filterSub ; break ; case jsPDFAPI . image_compression . MEDIUM : level = 6 ; filter_method = filterAverage ; break ; case jsPDFAPI . image_compression . SLOW : level = 9 ; filter_method = filterPaeth ; //uses to sum to choose best filter for each line break ; } bytes = applyPngFilterMethod ( bytes , lineLength , colorsPerPixel , filter_method ) ; var header = new Uint8Array ( createZlibHeader ( level ) ) ; var checksum = adler32 ( bytes ) ; var deflate = new Deflater ( level ) ; var a = deflate . append ( bytes ) ; var cBytes = deflate . flush ( ) ; var len = <mask> . length + a . length + cBytes . length ; var cmpd = new Uint8Array ( len + 4 ) ; cmpd . set ( header ) ; cmpd . set ( a , header . length ) ; cmpd . set ( cBytes , header . length + a . length ) ; cmpd [ len ++ ] = checksum >>> 24 & 0xff ; cmpd [ len ++ ] = checksum >>> 16 & 0xff ; cmpd [ len ++ ] = checksum >>> 8 & 0xff ; cmpd [ len ++ ] = checksum & 0xff ; return jsPDFAPI . arrayBufferToBinaryString ( cmpd ) ; }