• 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

iText library

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bruno

First of all I would like to thank you for a great book and library ! They do a great job!

I have couple of question regarding iText.

1. iText Book. Do you have a chapter where you explain how to create a PDF Portfolio (portable collection) ?
I had problem in the past printing big pdfs ( like 600 pages/ 300 MB), printer couldn't handle that resulting blank pages in the middle of the print. So I use PDF portfolio to print PDF forms;

2. You have a chapter about using HTML in PDF, does your library handle that by itself or xhtmlrenderer is needed ?

3. Is it possible to position pdf form elements by defining tany corner ( like (x,y) in mm ) ?


Cheers
Kuba Zygmunt

 
author
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kuba Zygmunt wrote:1. iText Book. Do you have a chapter where you explain how to create a PDF Portfolio (portable collection) ?



That's explained in chapter 16:
16.2.4: PDF packages, portable collections, or portfolios

Kuba Zygmunt wrote:2. You have a chapter about using HTML in PDF, does your library handle that by itself or xhtmlrenderer is needed ?



The HTML parsing functionality in iText is still limited as explained in chapter 9.
9.4.2: Parsing HTML
For a full-blown HTML parser, you still need Flying Sauces (aka xhtmlrenderer).

Kuba Zygmunt wrote:3. Is it possible to position pdf form elements by defining tany corner ( like (x,y) in mm ) ?



What is "tany corner"?
If you want to add a form element, you always need to specify the dimensions of the element.
Typically, you'll use a rectangle: (llx, lly, urx, ury) where llx stands for lower-left x and urx stands for upper-right x.
This is discussed in chapter 8.
 
Kuba Zygmunt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah sorry should be "any corner"

for example I would like to place Textfield 10 mm left from the left margin of the page or xx mm from other element, something like positioning in CSS ?
 
Bruno Lowagie
author
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kuba Zygmunt wrote:ah sorry should be "any corner"

for example I would like to place Textfield 10 mm left from the left margin of the page or xx mm from other element, something like positioning in CSS ?



PDF isn't HTML, moreover fields aren't part of the real content.
You can't compare a field in PDF to a field in HTML.
The underlying concepts are too different from each other.

Fields are visualized using widget annotations.
Widget annotations demand that you provide a rectangle.
I usually organize fields using a PdfPTable.
I use a cell event to find the coordinates I need for the rectangle.
 
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
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!