# File lib/fusioncharts/exporter/generator.rb, line 142
  def add_image_to_pdf(id=0, compress=true)
    @compress=compress
    bitmap_data = get_bitmap_data_24

    #PDF Object number
    img_obj_no= 6 + id*3
                
                #Get chart Image binary
                bitmap_data=get_bitmap_data_24(id)
                #Compress image binary
    if(@compress)
      begin
        cl = Zlib::Deflate
      rescue Exception
          raise NameError
      end
      image_binary = Zlib::Deflate.deflate(bitmap_data,9)
      compress_str = "/Filter /FlateDecode "
    else 
      image_binary=bitmap_data
      compress_str = ""
    end
                
                #get the length of the image binary
    len = image_binary.length
    
    width=@pages_data[id][:width].to_s
    height=@pages_data[id][:height].to_s
    
                #Build PDF object containing the image binary and other formats required
      pdf_image_str = img_obj_no.to_s+" 0 obj\n<<\n/Subtype /Image /ColorSpace /DeviceRGB /BitsPerComponent 8  /HDPI 72 /VDPI 72 "+ compress_str
      pdf_image_str+= "/Width "+width+" /Height "+height+" /Length "
      pdf_image_str+= len.to_s+" >>\nstream\n"
      pdf_image_str+= image_binary+"endstream\nendobj\n"
           return pdf_image_str
  end