Hello,
We are making an Android application that generates the pdf using some data.
We have used the Aspose.Pdf for Android 1.6.0 in our application.
We are trying to put an image in a Table layout.
There are 3 columns in out Table and 2 rows.
The first and last columns have 2 rows but we have merged the 2 rows of middle column with rowspan.
Now when we set an image in this merged rows, but the image is not displayed.
The code also doesn't show any error but image is also not displayed.
Can you please check it and let us know, what we are doing wrong in this approach.
The code which we have done for this is as below:
// Page 3
Page m_page3 = m_doc.getPages().add();
Table m_profileCont = new Table();
m_profileCont.getMargin().setLeft(- 90d);
m_page3.getParagraphs().add(m_profileCont);
m_profileCont.setColumnWidths("225 150 225");
MarginInfo m_profileMargin = new MarginInfo();
m_profileMargin.setTop(10f);
m_profileMargin.setBottom(10f);
m_profileMargin.setLeft(10f);
m_profileMargin.setRight(10f);
m_profileCont.setDefaultCellPadding(m_profileMargin);
TextState m_state = new TextState();
m_state.setFontSize(m_headerTitleSize);
m_state.setForegroundColor(com.aspose.java.awt.Color.BLACK);
m_state.setHorizontalAlignment(HorizontalAlignment.Center);
m_state.setFont(m_font);
LinkAnnotation m_link = new LinkAnnotation(m_page3,new Rectangle(100,100,300,300));
m_link.setContents("Open WebPage");
m_doc.getPages().get_Item(3).getAnnotations().add(m_link);
Row m_profileRow1 = m_profileCont.getRows().add();
m_profileRow1.getCells().add("");
m_profileRow1.getCells().add().getParagraphs().add(m_myAppLogo2);
//m_profileRow1.getCells().add("Center Col");
m_profileRow1.getCells().get_Item(1).setRowSpan(2);
m_profileRow1.getCells().add("");
//m_profileRow1.setDefaultCellBorder(m_borderForAllGry);
Row m_profileRow2 = m_profileCont.getRows().add();
m_profileRow2.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));
// m_profileRow2.getCells().get_Item(0).setRowSpan(2);
// m_profileRow2.getCells().add(" 2nd Row 2nd col").setBackgroundColor(Color.fromArgb(231, 234, 233));
m_profileRow2.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));
//m_profileRow2.setDefaultCellBorder(m_borderForAllGry);
Row m_profileRow3 = m_profileCont.getRows().add();
m_profileRow3.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow3.getCells().add("Sample Name",m_state).setBackgroundColor(Color.fromArgb(231, 234, 233));
m_profileRow3.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
//m_profileRow3.setDefaultCellBorder(m_borderForAllGry);
Row m_profileRow4 = m_profileCont.getRows().add();
Table m_email = new Table();
m_email.setColumnWidths("100");
Row m_emailConRow = m_email.getRows().add();
m_emailConRow.getCells().add("Email");
m_emailConRow.setDefaultCellBorder(m_borderForBottom);
m_profileRow4.getCells().add().getParagraphs().add(m_email);
m_profileRow4.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow4.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
Row m_profileRow5 = m_profileCont.getRows().add();
m_profileRow5.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow5.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow5.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
Row m_profileRow6 = m_profileCont.getRows().add();
m_profileRow6.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow6.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
m_profileRow6.getCells().add("").setBackgroundColor(Color.fromArgb(231, 234, 233));;
setHeaderToPdf("MyApp",m_doc,FILE);
Please let us know what we are doing wrong?