• 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
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Inserting a PDF document into a new PDF Page

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project to insert PDF document in the middle of a PDF page built in Java (using iText Library). I am able to do that but my problem is that everytime it put the PDF document at the first page, at the top. I can not insert it where ever I want. I appreciate any help.
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PDFBox library can chop a PDF into individual PDFs containing one page each. It also can assemble a new PDF from single-page PDFs. Those two functionalities combined should let you achieve what you're asking. For high-level manipulations like this I find PDFBox easier to use than iText.
 
Fred Khadour
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer, Thank you for your help. In fact, I did what you said by using PDFBox library. I read PDF into PDDocument then into PDF pages. Each page is converted to BufferedImage then into Image so I can set the image inside PdfCell of iText (I have to build my PDF document with iText because I have other stuff to add to the page.) Anyway, it looks working fine. I am able to insert PDF images anywhere inside my new PDF document. However, it add extra empty page after each PDF image!!! Any clue how to fix that, thank you.
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!