This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Inserting Image in a PDF File generated using JAVA PdfWriter object

 
alpesh helwatkar
Ranch Hand
Posts: 30
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed a web application in java.

i have some records which i display it on a dynamically created pdf using an object of pdfwriter.

i display all the records in a table.

The pdf document has a header and a footer in it

after the header the table consisting of all the data starts until all the data is finished.

now i have to insert an image on every page of the pdf at top position maybe in the header if possible!!

i've tried it but it gets inserted only in the first page and the last page that implies that the image is inserted before the table creation and after the table ends...


please guys if anyone knows the solution help me out...


the Code:---
 
Tekchand Prasad
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This example insert image on each page of pdf, hope it will help you.
 
alpesh helwatkar
Ranch Hand
Posts: 30
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Techchand,

Thanks for your prompt reply.

I tried your code.. it works but

works same as mine...

can you please tell me where to exactly merge your code in the code which i have provided.!?

i'm having serious problems with document.page() thing.

what its doing now is it is altogether creating new pages and then pasting the images without the data.

please do help..
 
Create symphonies in seed and soil. For this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!