# File lib/barby/outputter/pdfwriter_outputter.rb, line 22
    def annotate_pdf(pdf, options={})
      with_options options do

        xpos, ypos = x, y
        orig_xpos = xpos

        if barcode.two_dimensional?
          boolean_groups.reverse_each do |groups|
            groups.each do |bar,amount|
              if bar
                pdf.move_to(xpos, ypos).
                  line_to(xpos, ypos+xdim).
                  line_to(xpos+(xdim*amount), ypos+xdim).
                  line_to(xpos+(xdim*amount), ypos).
                  line_to(xpos, ypos).
                  fill
              end
              xpos += (xdim*amount)
            end
            xpos = orig_xpos
            ypos += xdim
          end
        else
          boolean_groups.each do |bar,amount|
            if bar
              pdf.move_to(xpos, ypos).
                line_to(xpos, ypos+height).
                line_to(xpos+(xdim*amount), ypos+height).
                line_to(xpos+(xdim*amount), ypos).
                line_to(xpos, ypos).
                fill
            end
            xpos += (xdim*amount)
          end
        end

      end

      pdf
    end