Sign In  Sign Up Live-Chat

Add a Table in Footer and Lining up Image and Table Margins

Last post 08-07-2008, 2:45 AM by vland. 16 replies.
Page 1 of 2 (17 items)   1 2 Next >
Sort Posts: Previous Next
  •  03-26-2008, 6:07 PM 119370

    Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    I am evaluating Aspose.PDF for Java.

    I am unable to get an image to line up with a table in the left margin.  Here is a snippet of the code:

    ...
    MarginInfo marginInfo = new MarginInfo();
    marginInfo.setTop(24);
    marginInfo.setBottom(24);
    marginInfo.setLeft(72);
    marginInfo.setRight(24);
    sec1.getPageSetup().setMargin(marginInfo);

    Table table = new Table(sec1);
    table.setColumnWidths("135 150 125 90");
    table.setMargin(marginInfo);
    ...

    Also, I am trying to add a table to the footer.  The code compiles, but I get an error when trying to open the document.  Here is a snippet of the code:

    HeaderFooter foot = new HeaderFooter(sec1);
               
    Table table2 = new Table(sec1);

    table2.setColumnWidths("150 150 150");
    table2.setMargin(marginInfo);
                   
    Row row1_t2 = new Row(table2);
    table2.getDefaultCellTextInfo().setFontName("Arial");
    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
    table2.getDefaultCellTextInfo().setTrueTypeBold(true);
    table2.getDefaultCellTextInfo().setFontSize(9);
    table2.getRows().add(row1_t2);
                    
    Cell cell1_t2 = new Cell(table2, "Details");
    row1a.getCells().add(cell1_t2);
                       
    Cell cell2_t2 = new Cell(table2, "Project Info");
    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Center);
    row1a.getCells().add(cell2_t2);
                   
    Cell cell3_t2 = new Cell(table2, "Action Item/Task 920-1");
    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Right);
    row1a.getCells().add(cell3_t2);
    foot.getParagraphs().add(table2);

    Thanks for your help!
                   

     
  •  03-27-2008, 1:32 PM 119512 in reply to 119370

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    I have tested this issue and I am unable to reproduce the error. Can you please send us your complete code along with the output pdf that you get so that we can better understand the problem.

    Thanks.

     
  •  03-28-2008, 4:43 PM 119695 in reply to 119370

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    Just wondering if anyone had a chance to look at this?  Do you need additional information? 

    Is it possible to get an image and table to align using the margininfo for the left margin?

    Is my code correct for having a table in a footer?

    Thanks!

     
  •  03-28-2008, 4:44 PM 119696 in reply to 119695

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    Disregard my previous message today.  I didn't see your reply.  Will send you code...

     
  •  03-28-2008, 5:19 PM 119702 in reply to 119512

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    Below is the code:

                    Pdf pdf = new Pdf();
               
                    //add a section
                    Section sec1 = pdf.getSections().add();

                    MarginInfo marginInfo = new MarginInfo();

                    marginInfo.setTop(24);

                    marginInfo.setBottom(24);

                    marginInfo.setLeft(72);

                    marginInfo.setRight(24);

                    sec1.getPageSetup().setMargin(marginInfo);
     
                    
                    Text text1 = new Text(sec1,"Description");
                    text1.getTextInfo().setTrueTypeBold(true);
                    sec1.getParagraphs().add(text1);        
               
      
                     MarginInfo marginInfo2 = new MarginInfo();

                     marginInfo.setTop(48);

                     marginInfo.setBottom(24);

                     marginInfo.setLeft(36);

                     marginInfo.setRight(36);
                    
                    Table table = new Table(sec1);
                 
                    table.setColumnWidths("135 150 125 90");

                    table.setMargin(marginInfo2);
                   

                    //add a row
                    Row row21 = new Row(table);
                    table.getRows().add(row21);
                   
                    table.getDefaultCellTextInfo().setTrueTypeBold(false);  
                    table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
                    Cell cell211 = new Cell(table, "Updated");
                    row21.getCells().add(cell211);
                   
                    table.getDefaultCellTextInfo().setTrueTypeBold(false); 
                    table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);              
                    Cell cell212 = new Cell(table,"S. Smith");
                    row21.getCells().add(cell212);

                    table.getDefaultCellTextInfo().setTrueTypeBold(false);  
                    table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
                    Cell cell213 = new Cell(table,"Jan 2006");
                    row21.getCells().add(cell213);
                   
                    table.getDefaultCellTextInfo().setTrueTypeBold(false); 
                    table.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);                
                    Cell cell214 = new Cell(table,"Updated - Testing.");
                    row21.getCells().add(cell214);

                    sec1.getParagraphs().add(table);
                   
                //add a header to section sec1
                HeaderFooter head = new HeaderFooter(sec1);
                Text headText = new Text(sec1,"Report Header");
                head.getParagraphs().add(headText);
                sec1.setOddHeader(head);
               
                //add a footer to section sec1
                HeaderFooter foot = new HeaderFooter(sec1);

               
                    Table table2 = new Table(sec1);
                   

                    table2.setColumnWidths("150 150 150");

                    table2.setMargin(marginInfo2);
                   
                    //Action Item Details
                    Row row1_t2 = new Row(table2);
                    table2.getDefaultCellTextInfo().setFontName("Arial");
                    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Left);
                    table2.getDefaultCellTextInfo().setTrueTypeBold(true);
                    table2.getDefaultCellTextInfo().setFontSize(9);
                    table2.getRows().add(row1_t2);
                   
                    Cell cell1_t2 = new Cell(table2, "Project Details");

                    row1a.getCells().add(cell1_t2);
                       
                    Cell cell2_t2 = new Cell(table2, "Project Info");
                    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Center);
                    row1a.getCells().add(cell2_t2);
                   
                    Cell cell3_t2 = new Cell(table2, "Details");
                    table2.getDefaultCellTextInfo().setAlignmentType(com.aspose.pdf.elements.AlignmentType.Right);
                    row1a.getCells().add(cell3_t2);
                   
                   
                foot.getParagraphs().add(table2);
                sec1.setOddFooter(foot);
               
                FileOutputStream out = new FileOutputStream(new File("HeaderAndFooterExample.pdf"));
                pdf.save(out);

     
  •  03-28-2008, 5:27 PM 119703 in reply to 119512

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi,

    By the way, I am able to get the left border of the image to line up with the left border of the table.

    So, just need help on putting a table inside of a footer.

    Thanks!

     
  •  03-28-2008, 11:01 PM 119718 in reply to 119703

    Re: Add a Table in Footer and Lining up Image and Table Margins

    I have logged this issue as PDFJAVA-4724. We will provide ETA soon.
    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  05-26-2008, 6:39 AM 128630 in reply to 119718

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Is it now possible to show a table in a footer/header?

    thanks for help
    vland
     
  •  05-26-2008, 7:11 AM 128635 in reply to 128630

    Re: Add a Table in Footer and Lining up Image and Table Margins

    I tested it and no table is working in a footer.
    When will it possible?

    I use the aspose PDF for Java.

    thanks for help
    vland
     
  •  05-26-2008, 8:55 AM 128644 in reply to 128635

    Re: Add a Table in Footer and Lining up Image and Table Margins

        Sorry, Add a Table in Footer is very difficult because at first we think we only have to support Text in footer. Now, many customers demand us to support Table, Image, Graph in header and footer, and we are working hard on this issue. We will support this function in the next 2 months and we'll provide your the hotfix as soon as we can support Table in Footer.
        We are very appreciate for your patience and deeply sorry for delaying your work for such a long time.

    Sandy.Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  06-11-2008, 3:26 AM 130891 in reply to 128644

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Is there any date where tables in header/footer are supported?

    thanks
    vland
     
  •  06-11-2008, 8:53 PM 131018 in reply to 130891

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hi, vland,
        We plan to resolve this problem in next two months. We'll give you an answer as soon as we find a solution. Thank you for your patience.
    Sandy.Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-05-2008, 9:00 AM 138393 in reply to 131018

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Hello,
    anything new about this issue?
    My customer is waiting for it.

    sincerely
    vland
     
  •  08-06-2008, 7:34 AM 138533 in reply to 138393

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Attachment: Present (inaccessible)
    Hello vland,

    We have resolved this problem. You can try the hotfix in the attachment. I have used that hotfix to run your code. You can see the result PDF file in the attachment.

    I'm very appreciate for your patience and sincerely hope this hotfix will help.Thank you for using our product.

    Sandy.Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-06-2008, 11:34 AM 138584 in reply to 138533

    Re: Add a Table in Footer and Lining up Image and Table Margins

    Many Thanks!
    The Fix is working successfully.
    But everytime i generate a PDF the javaw.exe is trying to access the device D:.
    On my system D is the CD-Rom Device.

    sincerly
    vland
     
Page 1 of 2 (17 items)   1 2 Next >
View as RSS news feed in XML