can you help me please. i posted my issue on this link below. TEXT1 TEXT2
http://www.aspose.com/docs/display/pdfnet/HTML+Tags+in+Text
In view of my 2 scenarios, i have problem with scenario#2. second text is not getting bold.
Although, IsHtmlTagSupported = true; and IsHtml5Supported = true;
Can you please check this.
SCENARIO1: all text become bold
SCENARIO2: first text become bold only
TEXT1
TEXT2
code:
var txt= new Text(section1 mytxtstr);
txt.IsHtmlTagSupported = true;
section1.Paragraphs.Add(txt);
Rolly Hernando
Email: rlhernando@iscksa.com/rollyhernando@live.com
Hi Rolly,
Document pdfDocument = new Document();<o:p></o:p>
Page page = pdfDocument.Pages.Add();
HtmlFragment html = new
HtmlFragment(" TEXT1 TEXT2
HtmlFragment html1 = new
HtmlFragment(" TEXT12 TEXT22
page.Paragraphs.Add(html);
page.Paragraphs.Add(html1);
pdfDocument.Save(myDir + "HtmltoPDF.pdf");
tital,
you missed the 2nd scenario. yah its fine there's no problem that html string you mentioned here.
but the problem is if the 2 string is enclosed with only one
the other string will not become bold. please try to check my scenario. I have again:
Notice 2nd bullet, strikethrough will only display when enclose in
tag.
Any help please.
- This quotation is based on the:
- Provided Bill of Material
-
Provided Single Line Diagram
Provided Layout drawingsProvided Specifications and latest requirements.
- Unless otherwise stated on each system details; Civil, Electrical & Rough-in Works are excluded.
- Unless otherwise stated on each system breakdown; Cables & Cable pulling are not included, any related cable tagging or cable testing is not included as well
Hi Rolly,
Document pdfDocument = new Document();
Page page = pdfDocument.Pages.Add();
HtmlFragment html = new
HtmlFragment(" TEXT1 TEXT2
HtmlFragment html1 = new
HtmlFragment("
");
Provided Single Line
DiagramProvided Layout drawingsProvided Specifications
and latest requirements.
page.Paragraphs.Add(html);
page.Paragraphs.Add(html1);
pdfDocument.Save(myDir + "HtmltoPDF.pdf");
Please feel free to contact us for any further assistance.
Best Regards,
Yeah it’s solve now.
But, you mean NO MORE initialization of Heading and Segment to create Bullets?
Thanks,
Hi Rolly,
Hi All,
Is this issue solved? can we display list of text phrases with bullet in points in Aspose PDF java?
Thanks,
Balakumar
@BalakumarSeethapathy,
The linked ticket ID PDFNET-38422 is pending for the analysis and not resolved yet. We have logged an ETA request under the same ticket ID PDFNET-38422 in our issue tracking system. We will let you know once a significant progress has been made in this regard. Please note, we auto-port each Aspose.Pdf for Java API version from its equivalent .NET version, so this feature will also be supported once the ticket ID PDFNET-38422 is resolved.
@rollyhernando, @BalakumarSeethapathy,
Please try the following code to add bullet in the PDF document (Java/.NET):
[.NET]
String dataDir = "C:\\Pdf\\test258\\";
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;
Aspose.Pdf.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("Bullet 1");
TextSegment seg = new TextSegment("•");
seg.TextState.Font = FontRepository.FindFont("Calibri");
seg.TextState.FontSize = 12;
seg.TextState.ForegroundColor = Aspose.Pdf.Color.Black;
Heading heading4 = new Heading(1);
heading4.StartNumber = 1;
heading4.Text = "Clinical indicator:";
heading4.UserLabel = seg;
heading4.IsAutoSequence = true;
floatBox.Paragraphs.Add(heading4);
pdfDoc.Save(dataDir + "bullet_NET.pdf");
This is the output PDF document: bullet_NET.pdf (1.9 KB)
[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)