<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/lib/create_new_pages_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+# Suppress warning messages about &quot;already initialized constant ..&quot; from java
+$VERBOSE = nil
+
 require 'fileutils'
 require 'tmpdir'
 require 'tempfile'
@@ -10,13 +13,15 @@ Rjb::load load_path, options
 FileOutputStream      = Rjb::import('java.io.FileOutputStream')
 ByteArrayOutputStream = Rjb::import('java.io.ByteArrayOutputStream')
 ByteArrayInputStream  = Rjb::import('java.io.ByteArrayInputStream')
+RandomAccessFile      = Rjb::import('java.io.RandomAccessFile')
 PdfWriter             = Rjb::import('com.lowagie.text.pdf.PdfWriter')
 PdfReader             = Rjb::import('com.lowagie.text.pdf.PdfReader')
 PdfCopy               = Rjb::import('com.lowagie.text.pdf.PdfCopy')
 PdfImportedPage       = Rjb::import('com.lowagie.text.pdf.PdfImportedPage')
+PdfDocument           = Rjb::import('com.lowagie.text.pdf.PdfDocument')
 Document              = Rjb::import('com.lowagie.text.Document')
 Paragraph             = Rjb::import('com.lowagie.text.Paragraph')
-Image                 = Rjb::import('import com.lowagie.text.Image')
+Image                 = Rjb::import('com.lowagie.text.Image')
 AcroFields            = Rjb::import('com.lowagie.text.pdf.AcroFields')
 PdfStamper            = Rjb::import('com.lowagie.text.pdf.PdfStamper')
 HashMap               = Rjb::import('java.util.HashMap')</diff>
      <filename>lib/pdf_filler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,6 @@ module RenoRB
         
         @check_boxes = {}
         
-        #@images = {}
         @images = []
         
         @radio_buttons = {}
@@ -105,8 +104,8 @@ module RenoRB
       # # Alias for the set_image method
       # alias :image :set_image      
       
-      def set_image(value)
-        @images
+      def place_image(path, x, y)
+        @images &lt;&lt; {:path =&gt; path, :x =&gt; x, :y =&gt; y}
       end
       
       # Sets a known radio button in the PDF template.
@@ -208,7 +207,14 @@ module RenoRB
           form.setField(field.to_s, value.to_s)
         end        
 
-        # TODO: do something with @images 
+        @images.each do |image|
+          img = Image.getInstance(image[:path])
+          img.setAbsolutePosition(image[:x], image[:y])
+          
+          # For now only consider the first page
+          pcb = stamper.getUnderContent(1) 
+          pcb.addImage(img)
+        end
 
         stamper.setFormFlattening(true)
         stamper.close                    
@@ -234,7 +240,14 @@ module RenoRB
           form.setField(field.to_s, value.to_s)
         end        
 
-        # TODO: do something with @images 
+        @images.each do |image|
+          img = Image.getInstance(image[:path])
+          img.setAbsolutePosition(image[:x], image[:y])
+          
+          # For now only consider the first page
+          pcb = stamper.getUnderContent(1) 
+          pcb.addImage(img)
+        end
 
         stamper.setFormFlattening(true)
         stamper.close</diff>
      <filename>lib/pdf_filler/page.rb</filename>
    </modified>
    <modified>
      <diff>@@ -88,11 +88,11 @@ describe 'Page' do
   end
   
   it 'should add an image to the document at the specified location' do
-    img1.setAbsolutePosition(50, 500);
     page = PDFPage(File.expand_path(File.dirname(__FILE__) + '/../templates/image_template.pdf'))
     page.set_text_field(:full_name, 'Anna Hays')        
-    page.set_image(:home_owner, 'Yes') 
+    page.place_image(File.expand_path(File.dirname(__FILE__) + '/../templates/kid.jpg'), 0, 10)
     page.save_to(File.expand_path(File.dirname(__FILE__) + '/../output/image_test.pdf'))
     File.exist?(File.dirname(__FILE__) + '/../output/image_test.pdf').should be_true    
   end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/lib/pdf_page_spec.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>spec/templates/image_template.pdf</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/output/place.holder</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>a50d8e87272c876a2bca6d683593c10bee9a8681</id>
    </parent>
  </parents>
  <author>
    <name>Wes Hays</name>
    <email>weshays@gbdev.com</email>
  </author>
  <url>http://github.com/weshays/pdf_filler/commit/1b3102b37b29846d2d257b656daa1cb7f97952c2</url>
  <id>1b3102b37b29846d2d257b656daa1cb7f97952c2</id>
  <committed-date>2009-11-07T10:47:11-08:00</committed-date>
  <authored-date>2009-11-07T10:47:11-08:00</authored-date>
  <message>Added more tests and worked on adding (placing) an image to an existing PDF.</message>
  <tree>d49cd4267d0313bad473283683f9d5841cb43d25</tree>
  <committer>
    <name>Wes Hays</name>
    <email>weshays@gbdev.com</email>
  </committer>
</commit>
