We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Row span for image not working

Hi ,

Please find my sample code.I have to span the image to next 2 rows and the code is not working.Please help.I have to address this immediately

It is noticed that the rowspan for cell is working for TextFragement.(See underlined commented code )

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import com.aspose.pdf.CellBorderStyle;

import com.aspose.pdf.Color;

import com.aspose.pdf.Document;

import com.aspose.pdf.Image;

import com.aspose.pdf.License;

import com.aspose.pdf.MarginInfo;

import com.aspose.pdf.Page;

import com.aspose.pdf.PageInfo;

public class TestAsposeImageSpan {

public static void main(String[] args) throws FileNotFoundException {

java.util.Locale locale1 = new java.util.Locale("en");


License lic = new License();

lic.setLicense(new FileInputStream(


// Added document

Document doc = new com.aspose.pdf.Document();

PageInfo pageInfo = doc.getPageInfo();

MarginInfo marginInfo = pageInfo.getMargin();






com.aspose.pdf.Table table = new com.aspose.pdf.Table();

table.setColumnWidths("50 100");

// added page.

Page curPage = doc.getPages().add();

for(int i=1;i<=3;i++){

CellBorderStyle style = new CellBorderStyle(Color.getRed());


com.aspose.pdf.Row row = table.getRows().add();


com.aspose.pdf.Cell cell1 = row.getCells().add();

//cell1.setBorder(new BorderInfo(BorderSide.All,style));

cell1.getParagraphs().add(new com.aspose.pdf.TextFragment("Content 1"));

com.aspose.pdf.Cell cell2 = row.getCells().add();

//cell2.setBorder(new BorderInfo(BorderSide.All,style));

if(i==1 ){

Image image = new Image();

image.setImageStream(new FileInputStream("boys.jpg"));




cell2.getParagraphs().add(new com.aspose.pdf.TextFragment("Span please"));*/


cell2.getParagraphs().add(new com.aspose.pdf.TextFragment(""));







Hi Basil,

We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for Java 4.5.1, We have managed to reproduce the reported row span issue with image and logged it in our bug tracking system as PDFNEWJAVA-34042 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

The issues you have found earlier (filed as PDFNEWJAVA-34042) have been fixed in Aspose.Pdf for Java 11.0.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.