>I would ask the more general question, "does anyone have a good
>diff or comparison utility for PDF files?"

>I have my reflection invoked dumper, if I get time I'd be curious to
see if
>I could find the differences if you could post the two files.  Not sure

>about the OS differences but certainly anyone working with PDF files
must
>have some utilities of this type, RUP perhaps or simply pdftk would
help
>isolate the problem?


I have attached copies of the PDF files that were generated from the
same code.

Code is: (BTW, I am using iText-2.1.5 and Java 5)

float[] widths = {0.40f, 0.10f, 0.10f, 0.10f, 0.30f};
PdfPTable table = new PdfPTable(widths);
table.setWidthPercentage(95f);

PdfPCell cell = null;

table.addCell(createHeaderPCell("Task"));
table.addCell(createHeaderPCell("Start", true));
table.addCell(createHeaderPCell("Stop", true));
table.addCell(createHeaderPCell("Duration", true));
table.addCell(createHeaderPCell("Comments"));

ArrayList<ManImpl> mans = taskModel.getWorkerList();
for(ManImpl man: mans) {
        cell =  new PdfPCell(new Paragraph(man.getName(), new
Font(Font.HELVETICA, 14, Font.BOLD)));
        cell.setColspan(5);
        table.addCell(cell);

        ArrayList<TaskImpl> tasks = taskModel.getTasksForMan(man);

        for(TaskImpl task: tasks) {
                cell = createTextPCell(task.getName());
                table.addCell(cell);
                table.addCell( createTextPCell( Utils.formatShortDate(
task.getStartDate()), true));
                table.addCell( createTextPCell( Utils.formatShortDate(
task.getFinishDate()), true));
                table.addCell( createTextPCell( String.valueOf(
task.getDuration()), true));
                cell = createTextPCell(task.getComment());
                table.addCell(cell);
        }
}

document.add(table);

===================

        private PdfPCell createTextPCell(String text, boolean center) {
                PdfPCell cell = createTextPCell(text);
                cell.setHorizontalAlignment(Element.ALIGN_LEFT);
                cell.setVerticalAlignment(Element.ALIGN_BASELINE);
                cell.setNoWrap(false);
                cell.setPadding(.1f);
                if (center) {
                        centerPCell(cell);
                }
                return cell;
        }

        private PdfPCell createTextPCell(String text) {
                if (text != null) {
                        return new PdfPCell(new Paragraph(text, new
Font(Font.HELVETICA)));
                } else {
                        return new PdfPCell(new Paragraph(""));
                }
        }

        private PdfPCell createHeaderPCell(String text, boolean center)
{
                PdfPCell cell = createTextPCell(text);
                cell.setGrayFill(.75f);
                if (center) {
                        centerPCell(cell);
                }
                return cell;

        }

Confidentiality Notice: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain information that is 
confidential privileged and/or exempt from disclosure under applicable law.  
Any unauthorized review, use, disclosure or distribution is prohibited.  If you 
are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.




Confidentiality Notice: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain information that is 
confidential privileged and/or exempt from disclosure under applicable law.  
Any unauthorized review, use, disclosure or distribution is prohibited.  If you 
are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

Attachment: TaskBlocksReport_from_windows.pdf
Description: TaskBlocksReport_from_windows.pdf

Attachment: TaskBlocksReport_from_mac.pdf
Description: TaskBlocksReport_from_mac.pdf

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to