It's quite possible the fonts are different on the two systems.
What OS's are in use in both systems? What VERSION of each OS
(keeping in mind service packs, etc.)?
Do you have any extra software (MSOffice, Adobe Creative Suite,
WordPerfect, etc.) that might have done font installation on one but
not the other?
Leonard
On May 13, 2008, at 6:35 AM, Jantek Balázs wrote:
What does this information tell us?
I've searched the context of these changes, and there's
indeed a difference in the offset of the header lines on
page 1 and the stuff in the table on page 2.
All the rest of the content file is identical.
My suggestion would be: check if you are really using the
same code at home as on the office.
br,
Bruno
******
hi,
i packed the whole office project, took it on my home laptop
and run the program without any modification, and the
result is still different...
to avoid cell text go out of the cell, i have to comment
the following lines:
cell.setVerticalAlignment(((TRow.TCell) ((TRow) rows.get
(rc)).cells.get(cc)).getVerticalAlignment());
cell.setUseAscender(true);
cell.setUseDescender(true);
but this way the vertical alignment feature is lost of my program.
is it possible, that the problem is caused by the setUseAscender-
Descender
methods? i mean the fonts might be somehow different on the two
system..?
************
the pdfPtable is constructed in my code the following way:
private void closeTable() {
pdfTable = new PdfPTable(cellRightSides.size());
for(int rc = 0; rc < rows.size(); rc++) {
int lastRSIndex = -1;
for(int cc = 0; cc < ((TRow) rows.get(rc)).cells.size(); cc++) {
PdfPCell cell = new PdfPCell();
int nextRS = ((TRow.TCell) ((TRow) rows.get(rc)).cells.get
(cc)).rightSide;
int nextRSIndex = cellRightSides.indexOf(new Integer(nextRS));
cell.setColspan(nextRSIndex - lastRSIndex);
lastRSIndex = nextRSIndex;
for(int contentIndex = 0; contentIndex < ((TRow.TCell)
((TRow) rows.get(rc)).cells.get(cc)).content.size(); contentIndex++) {
cell.addElement(
(Element) ((TRow.TCell)((TRow)rows.get(rc)).cells.get
(cc)).content.get(contentIndex));
}
//negative height indicates fixed height,
//positive height indicates at-least height
//according to RTF Specification.
if(((TRow) rows.get(rc)).getHeight() < 0) {
cell.setFixedHeight((float) -((TRow)rows.get(rc)).getHeight
() / 20);
// System.out.println("setting fixed height" );
}
if(((TRow) rows.get(rc)).getHeight() > 0) {
cell.setMinimumHeight((float) ((TRow)rows.get(rc)).getHeight
() / 20);
//cell.setFixedHeight((float) rows.get(rc).getHeight() / 20);
// System.out.println("setting minimum height");
}
if(((TRow)rows.get(rc)).getHeight() == 0) {
//cell.setMinimumHeight((float) rows.get(rc).getHeight() /
20);
//System.out.println("Cell without cell height.");
cell.setMinimumHeight(24f);
}
cell.setVerticalAlignment(((TRow.TCell) ((TRow) rows.get
(rc)).cells.get(cc)).getVerticalAlignment());
cell.setUseAscender(true);
cell.setUseDescender(true);
if(!((TRow.TCell)((TRow) rows.get(rc)).cells.get
(cc)).hasBorder()) {
cell.setBorder(Rectangle.NO_BORDER);
}
pdfTable.addCell(cell);
}
pdfTable.completeRow();
}
//Word allows to set column widths in different units for each
row
//Unfortunately in iText we are not allowed to do so.
//We use the unit of the first row for the whole table
float[] widths = new float[cellRightSides.size()];
float lastRS = 0;
for(int i = 0; i < cellRightSides.size(); i++) {
widths[i] = (((Integer )cellRightSides.get(i)).floatValue() -
lastRS) / 20;
lastRS = ((Integer) cellRightSides.get(i)).floatValue();
}
widths[0] -= tableLeftIndent / 20; // the left side of the
first column is not at 0
try { pdfTable.setTotalWidth(widths); } catch
(DocumentException de) {
System.out.println(de.getMessage());
}
pdfTable.setLockedWidth(true); // make the given widths
absolute values instead of %
pdfTable.setHorizontalAlignment(tableHorizontalAlignment);
pdfTable.setSpacingBefore(6f);
pdfTable.setSpacingAfter(6f);
this.doc.addTableToDocument(pdfTable);
}
}
and finally the referenced addTableToDocument is:
public void addTableToDocument(PdfPTable table) {
try {
//System.out.println("Adding table to document.");
if(table != null) {
if(this.rtfParser.inHeaderFooterSection ==
RtfParser.SECTION_DOC) {
this.rtfParser.getDocument().add(table);
} else {
System.out.println("Table sent to DestHF");
this.header.add(table);
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
this.table = null;
}
________________________________________________________
TEGYÉL FEL egy apróhirdetést és TEGYÉL EL egy Nintendo Wii
játékkonzolt.
Tegyél érte egy kattintást ide >>> www.apronet.hu/nyeremenyjatek
----------------------------------------------------------------------
---
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar