Actually, I think this might work:

I think PdfStamper from itext might be the answer. Here is some example code:

try {
      PdfReader pdfReader = new PdfReader("HelloWorld.pdf");

      PdfStamper pdfStamper = new PdfStamper(pdfReader,
            new FileOutputStream("HelloWorld-Stamped.pdf"));

      Image image = Image.getInstance("watermark.png");

      for(int i=1; i<= pdfReader.getNumberOfPages(); i++){

          PdfContentByte content = pdfStamper.getUnderContent(i);

          image.setAbsolutePosition(100f, 700f);

          content.addImage(image);
      }

      pdfStamper.close();

    } catch (IOException e) {
      e.printStackTrace();
    } catch (DocumentException e) {
      e.printStackTrace();
    }
  }


We would replace HelloWorld.pdf with a growthchart pdf and instead of watermark.png use an image of an appropriately sized dot. We would also call getOverContent instead of getUnderContent. We could then just add the dot image wherever we want to plot the data point.

On 9/22/2011 12:33 PM, Tammy Dugan wrote:
We would like to take pre-existing CDC growth chart PDFs and plot a child's growth point on the curve. I know we could plot the entire growth curve ourselves and add the patient specific points but I would like to find a way to use the existing CDC growth chart pdf (it would be hard to reproduce exactly), and just plot the patient points. Does anyone know of any java pdf libraries that will allow you to superimpose plot points on top of an existing pdf?

Thanks,

Tammy Dugan


--
Tammy Dugan
CHIRDL Technical Lead
Children's Health Services Research
IU School of Medicine

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to