0

I am trying to create an invoice using ItextSharp but I cant quite get what I want.

The invoice looks like this

Invoice

I can get the upper part using HtmlWorker but the mid section is somewhat challenging. Because the height of the mid section remains constant whether there are 1 or 2 or 5 number of items added. (it wont go beyond 4-5 items). I think I could have managed it with CSS but CSS doesnt work easily in case of HtmlWorker.

Do you have any Ideas how I could approach this problem?

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
SamuraiJack
  • 5,131
  • 15
  • 89
  • 195
  • `HtmlWorker` is no longer supported. CSS is not supported in `HtmlWorker`, only in XML Worker: http://itextpdf.com/sandbox/xmlworker – Bruno Lowagie Oct 28 '14 at 07:25
  • @BrunoLowagie does Xmlworker support CSS well? – SamuraiJack Oct 28 '14 at 07:45
  • It depends on what you expect. iText parses HTML content and flushes PDF pages to the outputstream ASAP. If you have some content at the end of an HTML page of which the CSS says: *you need to be on top of the (first) page*, then you are out of luck, because the first page has already been finalized. Otherwise, CSS support in XML Worker is great as you can tell from the examples. – Bruno Lowagie Oct 28 '14 at 07:54

0 Answers0