• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

itext and xml to PDF

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to create a "template" in xml that defines what my PDF will look like and dynamically replace a phone number in the pdf. I used the example online, but am having trouble with an image. When I tell the xml to put a new page, it does this for the text but the image prints on the first line right under the first image. Any idea what this isnt working for me?

Thanks!

<letter>
<image <image url="http://localhost/images/homepageImages/myimage.jpg" align="right"/>
To: <mail /><newline />
Ref: your website<newline />
<newline />
Hello <givenname />,<newline />
<newline />
I visited your website a while ago (<website /> and I saw you added
<newpage />

<image url="http://localhost/images/homepageImages/myimage.jpg" align="right"/>
To: <mail /><newline />
Ref: your website<newline />
<newline />
Hello <givenname />,<newline />
<newline />
I visited your website a while ago (<website /> and I saw you added
kind regards,<newline />
Bruno Lowagie
</letter>
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not following what you are trying to achieve, and where the problem is. Can you post a relevant excerpt of your code, and an example PDF that's incorrect?
 
Mike Blair
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am doing the tutorial here (http://www.lowagie.com/iText/tutorial/ch07.html) for the Data Merging example. The only difference is in my XML I put the code twice and put it on two pages. This worked fine. Then, I tried adding an image to the top of the two pages. Both images show up on the top of the first page though instead of one image on each page.

Thanks,
Mike
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic