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

Free Support Forum - aspose.com

Bullets and borders

Hi,

I just want to know how to add bullets in my pdf. For reference please look at the attached screenshot.
and I also want to know how to add a border in my pdf file generated.
I am using aspose.PDF for .NET.

Thanx
Untitled.png (8.3 KB)

@shubhamkataria143

Thank you for contacting support.

You may add bullets on a PDF page by using below code snippet:

Document pdfDoc = new Document();
pdfDoc.PageInfo.Width = 612.0;
pdfDoc.PageInfo.Height = 792.0;
pdfDoc.PageInfo.Margin.Left = 72;
pdfDoc.PageInfo.Margin.Right = 72;
pdfDoc.PageInfo.Margin.Top = 72;
pdfDoc.PageInfo.Margin.Bottom = 72;
Page pdfPage = pdfDoc.Pages.Add();
pdfPage.PageInfo.Width = 612.0;
pdfPage.PageInfo.Height = 792.0;
pdfPage.PageInfo.Margin.Left = 72;
pdfPage.PageInfo.Margin.Right = 72;
pdfPage.PageInfo.Margin.Top = 72;
pdfPage.PageInfo.Margin.Bottom = 72;
FloatingBox floatBox = new FloatingBox();
floatBox.Margin = (pdfPage.PageInfo.Margin);
pdfPage.Paragraphs.Add(floatBox);
TextSegment seg = new TextSegment("•");
seg.TextState.Font = FontRepository.FindFont("Calibri");
seg.TextState.FontSize = 12;
seg.TextState.ForegroundColor = Color.Black;
Heading heading4 = new Heading(1);
heading4.IsInList = true;
heading4.StartNumber = 1;
heading4.Text = "Clinical indicator:";
heading4.UserLabel = seg;
heading4.IsAutoSequence = true;
floatBox.Paragraphs.Add(heading4);
pdfDoc.Save(dataDir + "Bullet_19.2.pdf");

Moreover, border can be added to a page using below code:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Aspose.Pdf.Page page = doc.Pages.Add();
Aspose.Pdf.Drawing.Graph graph = new Aspose.Pdf.Drawing.Graph((float)page.PageInfo.Width, (float)page.PageInfo.Height);
page.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
page.Paragraphs.Add(graph);
Aspose.Pdf.Drawing.Line bottomline = new Aspose.Pdf.Drawing.Line(new float[] { 10, 10, (float)page.PageInfo.Width - 10, 10 });
Aspose.Pdf.Drawing.Line topline = new Aspose.Pdf.Drawing.Line(new float[] { 10, (float)page.PageInfo.Height - 10, (float)page.PageInfo.Width - 10, (float)page.PageInfo.Height - 10 });
Aspose.Pdf.Drawing.Line rightline = new Aspose.Pdf.Drawing.Line(new float[] { (float)page.PageInfo.Width - 10, 10, (float)page.PageInfo.Width - 10, (float)page.PageInfo.Height - 10 });
Aspose.Pdf.Drawing.Line leftline = new Aspose.Pdf.Drawing.Line(new float[] { 10, 10, 10, (float)page.PageInfo.Height - 10 });
graph.Shapes.Add(topline);
graph.Shapes.Add(bottomline);
graph.Shapes.Add(rightline);
graph.Shapes.Add(leftline);          
graph.ZIndex = 0;
doc.Save(dataDir + "PageBorder.pdf");

We hope this will be helpful. Please feel free to contact us if you need any further assistance.