Second text is not getting bold

can you help me please. i posted my issue on this link below.

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

TEXT1

TEXT2

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,


Thanks for your inquiry. I have tested your scenario with new DOM approach without any issue. Please use new DOM approach for HTML to PDF conversion, as it is more efficient and improved. Moreover, please note old generator (Aspose.Pdf.Generator) will be obsolete in near future


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");


Please feel free to contact us for any further assistance.

Best Regards,

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.


  1. This quotation is based on the:

    • Provided Bill of Material


    • Provided Single Line Diagram



    • Provided Layout drawings

    • Provided Specifications and latest requirements.



  2. Unless otherwise stated on each system details; Civil, Electrical & Rough-in Works are excluded.

  3. 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,


Thanks for your feedback. My apologies I missed the second scenario shared in first post. I have tested both missing and latest bullet related issue, but I am afraid I am unable to notice the issue while using new DOM approach. If you are getting the issue with bullets strikeout text, then please share your sample code and output PDF document to understand the issue.

Document pdfDocument = new Document();

Page page = pdfDocument.Pages.Add();

HtmlFragment html = new HtmlFragment("

TEXT1

TEXT2

");

HtmlFragment html1 = new HtmlFragment("

  1. This quotation is based on the:
    • Provided Bill of Material
    • Provided Single Line Diagram

    • Provided Layout drawings
    • Provided Specifications and latest requirements.
  2. Unless otherwise stated on each system details; Civil, Electrical & Rough-in Works are excluded.
  3. 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
");

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,


As shared in my other forum thread, the problem related to missing support for Bullet in Heading instance in new DOM approach is logged in our issue tracking system as PDFNEWNET-38422. The development team will further look into the details of this problem and we will keep you posted on the status of correction. Please be patient and spare us little time.

We are sorry for your inconvenience.

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)