pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haddy, Diane E" <diane-ha...@uiowa.edu>
Subject display an image in pdf
Date Fri, 18 Mar 2016 17:13:26 GMT
Hello

I have two questions.  I would like to display a .gif image into a pdf.  Can I use PDJpeg
class for .gif image?

And in this piece of code, which I got form the internet:

String imageName = "/images/arrow.gif;

  PDXObjectImage image = new PDJpeg(doc, new FileInputStream(imageName));
  PDPageContentStream content = new PDPageContentStream (doc, page)
  content.drawImage(image, 200, 500)
  content.close();

  doc.save(fileName)
  doc.close();

the file path is in the web directory of my java project.  However when I run this, I get
FileNotFoundException.  Any suggestions?

Thank you
Diane





Diane Haddy

Health Care Information Systems
Application Developer
3281 Ridgeway Dr
Coralville, IA 52241
Phone  (319) 384-9725



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications
Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are
not the intended recipient, you are hereby notified that any retention, dissemination, distribution,
or copying of this communication is strictly prohibited.  Please reply to the sender that
you have received the message in error, then delete it.  Thank you.
________________________________

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message