Hi all!
To start off, let me say that I'm using iText 5.3.5 to build PDF files on
*Android*.
First (smaller) problem is, how to have a "static" page header for
multi-page header that also includes (important!) a picture from Android
resources (or) assets? Is there an easy way to insert a Drawable into the
PDF generating process or is the conversion to com.itextpdf.text.Image
through byteArray necessary (which I've tried but ran into some problems):
Drawable d = context.getResources().getDrawable(R.drawable.logo);
Bitmap bitmap = ((BitmapDrawable) d).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] bitmapdata = stream.toByteArray();
try {
    com.itextpdf.text.Image image =
com.itextpdf.text.Image.getInstance(bitmapdata);
} catch (...)
{...}
Second problem - I have to build a table in which I don't add rows but
columns, i.e. first column is "static" and should repeat on every page, and
the number of pages varies depending on how many columns are generated (it's
sort of a report so I can't know beforehand).
Consider this scenario:

List<Car> cars = // get the list
for (Car car : cars) {
  // make a column with associated data in each cell
}

To produce something like this:
 ____________________________________
|             | Car 1 | Car 2 | Car 3 | ...... (possibly overflows to a
second, third, ... page       
|Year       | 1989 | 2006  | 2009  |
|Country  |  GER  | FRA   | ITA   |
|Manufac | Audi  | Seat  |  Fiat  |
| ...        |         |         |         |
_____________________________________

Sorry for the horrible formatting :)

I was googleing various solutions & suggestions but couldn't figure out this
(probably easy) problem, being a new user for iText. I looked at some
examples for ColumnText but for the heck of it can't figure out what it
exactly does or is it applicable for this problem. Unfortunately I can't
change the table design, it has to be generated this way.

Any sample code would be much appreciated!



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Android-iText-images-and-multi-page-vertically-split-tables-tp4657228.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to