Text Width and goto new column

Hi,

I try to put text in differents columns using isNewClumn method. But nothing changes. Same thing for text width.
Please could you explain me what i did wrong? Thx!!!

This my code:

try {
Pdf pdf = new Pdf();
pdf.getPageSetup().setPageHeight(PageSize.A4Width);
pdf.getPageSetup().setPageWidth(PageSize.A4Height);
Section seccion = pdf.getSections().add();
seccion.getColumnInfo().setColumnCount(2);
seccion.getColumnInfo().setColumnWidths(“250 250”);
seccion.getColumnInfo().setColumnSpacing(“10”);
BorderInfo bi = new BorderInfo( BorderSide.All, 0.1f, Color.Fuchsia);
seccion.getPageSetup().setPageBorder(bi);
Text texto = new Text(seccion,“Prueba de blablabla…”);
seccion.getParagraphs().add(texto);
//texto.setTop(10f);
//texto.setLeft(10f);
texto.setTextWidth(250f);
texto.getTextInfo().setBackGroundColor(Color.Black);
texto.getTextInfo().setTextColor(Color.Silver);
texto.getTextInfo().setTextBorder(bi);
seccion.isNewColumn(true);
texto = new Text(seccion,“Otra prueba de blablabla…”);
seccion.getParagraphs().add(texto);
//texto.setTop(10f);
//texto.setLeft(10f);
texto.setTextWidth(250f);
texto.getTextInfo().setBackGroundColor(Color.Black);
texto.getTextInfo().setTextColor(Color.Silver);
texto.getTextInfo().setTextBorder(bi);
response.setHeader(“Content-Disposition”, “attachment;filename=“prueba.pdf””);
response.setContentType(“application/pdf”);
pdf.save(response.getOutputStream());
} catch (AsposeBaseException ex) {
Logger.getLogger(Descarga.class.getName()).log(Level.SEVERE, null, ex);
}

Hi,

I try to put text in differents columns using isNewClumn method. But nothing changes. Same thing for text width.
Please could you explain me what i did wrong? Thx!!!

This my code:

try {
Pdf pdf = new Pdf();
pdf.getPageSetup().setPageHeight(PageSize.A4Width);
pdf.getPageSetup().setPageWidth(PageSize.A4Height);
Section seccion = pdf.getSections().add();
seccion.getColumnInfo().setColumnCount(2);
seccion.getColumnInfo().setColumnWidths(“250 250”);
seccion.getColumnInfo().setColumnSpacing(“10”);
BorderInfo bi = new BorderInfo( BorderSide.All, 0.1f, Color.Fuchsia);
seccion.getPageSetup().setPageBorder(bi);
Text texto = new Text(seccion,“Prueba de blablabla…”);
seccion.getParagraphs().add(texto);
//texto.setTop(10f);
//texto.setLeft(10f);
texto.setTextWidth(250f);
texto.getTextInfo().setBackGroundColor(Color.Black);
texto.getTextInfo().setTextColor(Color.Silver);
texto.getTextInfo().setTextBorder(bi);
seccion.isNewColumn(true);
texto = new Text(seccion,“Otra prueba de blablabla…”);
seccion.getParagraphs().add(texto);
//texto.setTop(10f);
//texto.setLeft(10f);
texto.setTextWidth(250f);
texto.getTextInfo().setBackGroundColor(Color.Black);
texto.getTextInfo().setTextColor(Color.Silver);
texto.getTextInfo().setTextBorder(bi);
response.setHeader(“Content-Disposition”, “attachment;filename=“prueba.pdf””);
response.setContentType(“application/pdf”);
pdf.save(response.getOutputStream());
} catch (AsposeBaseException ex) {
Logger.getLogger(Descarga.class.getName()).log(Level.SEVERE, null, ex);

I’ve to add that i can’t set Text absolute positioning using setTop and setLeft methods.

How can i set positioning type in PDF ?
setTop and setLeft are Paragraph object methods. It mains that same thing occure with all Paragraph objects ?

Please i need help.

Hello Jerome,

Thanks for considering Aspose.

I've tested the scenario and have noticed both the problems (isNewColumn & Text.setTop()/Text.setLeft()). We are looking into the details of these problems and will keep you updated with the status of correction. We apologize for your inconvenience.

Hello,

Aspose.pdf for java can not support absolute position for Paragraph. You need to set the page/Paragraph margin carefully to get your desired effect. We are now working on a new release which will support that function. But we will publish it in several months later.

Thank you for your patience.