Hi,
Could you please let me know if Aspose PDF has a feature to display a list of text items with bullet points?
Please share the API details or sample code if any available.
Thanks,
Balakumar
Hi,
Could you please let me know if Aspose PDF has a feature to display a list of text items with bullet points?
Please share the API details or sample code if any available.
Thanks,
Balakumar
@BalakumarSeethapathy,
Please try the following code example:
[Java]
String dataDir = "C:\\Pdf\\test258\\";
Document pdfDoc = new Document();
pdfDoc.getPageInfo().setWidth(612.0);
pdfDoc.getPageInfo().setHeight(792.0);
pdfDoc.getPageInfo().getMargin().setLeft(72);
pdfDoc.getPageInfo().getMargin().setRight(72);
pdfDoc.getPageInfo().getMargin().setTop(72);
pdfDoc.getPageInfo().getMargin().setBottom(72);
Page pdfPage = pdfDoc.getPages().add();
pdfPage.getPageInfo().setWidth(612.0);
pdfPage.getPageInfo().setHeight(792.0);
pdfPage.getPageInfo().getMargin().setLeft(72);
pdfPage.getPageInfo().getMargin().setRight(72);
pdfPage.getPageInfo().getMargin().setTop(72);
pdfPage.getPageInfo().getMargin().setBottom(72);
FloatingBox floatBox = new FloatingBox();
floatBox.setMargin(pdfPage.getPageInfo().getMargin());
pdfPage.getParagraphs().add(floatBox);
//TextSegment seg=new TextSegment("Bullet 1");
TextSegment seg = new TextSegment("•");
seg.getTextState().setFont(FontRepository.findFont("Calibri"));
seg.getTextState().setFontSize(12);
seg.getTextState().setForegroundColor(Color.getBlack());
Heading heading4 = new Heading(1);
heading4.setInList(true);
heading4.setStartNumber(1);
heading4.setText("Clinical indicator:");
heading4.setUserLabel(seg);
heading4.setAutoSequence(true);
floatBox.getParagraphs().add(heading4);
pdfDoc.save(dataDir + "bullet.pdf");
This is the output PDF document: bullet.pdf (1.9 KB)