The type or namespace name 'PdfHTMLTextElement' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'PdfHTMLTextElement' could not be found (are you missing a using directive or an assembly reference?)

i cannot use PdfHTMLTextElement while all other elements successfully added...

4 Replies

SL Sowmiya Loganathan Syncfusion Team June 9, 2020 01:05 PM UTC

Hi Harisankar,   
  
Thank you for contacting Syncfusion support.   
  
At present we do not have support to add HTML styled in PDF document in Xamarin Android platform. We have logged a feature request for this and we do not have any immediate plan to implement this feature. The status of this feature can be tracked through our Feature Management system,   
  
Please let us know if you have any concerns on this.   
  
Regards,  
Sowmiya Loganathan 



HA Harisankar June 9, 2020 01:22 PM UTC

Thanks for the reply 
But i saw some content regarding this from your forum
its already used by many developers

pls help me if you can ..pls

following are the sample code got from syncfusion 

PdfDocument doc = new PdfDocument();
//Add a page to the document.
PdfPage page = doc.Pages.Add();
//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;
//Set the font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 14);
//Simple HTML content
string htmlText = "Essential PDF is a .NET " + "library with the capability to produce Adobe PDF files ";
//Create new PDF HTML text element.
PdfHTMLTextElement htmlTextElement = new PdfHTMLTextElement(htmlText, font, PdfBrushes.Black);
htmlTextElement.TextAlign = TextAlign.Left;
//Format Layout.
PdfMetafileLayoutFormat format = new PdfMetafileLayoutFormat();
format.Layout = PdfLayoutType.Paginate;
format.Break = PdfLayoutBreakType.FitPage;
//Draw htmlString to PDF page.
htmlTextElement.Draw(page, new RectangleF(0, 0, page.GetClientSize().Width, page.GetClientSize().Height), format);
//Save the document.
doc.Save("Output.pdf");
//Close the document.
doc.Close(true);


SL Sowmiya Loganathan Syncfusion Team June 10, 2020 12:57 PM UTC

Hi Harisankar,    
   
The HTML text element in PDF document supports in base platforms like WF, WPF, ASP.NET, ASP.NET MVC, and ASP.NET Web Forms and not in UWP, ASP.NET Core and Xamarin Forms. So due to this platform specification, it does not support in Xamarin Android. These are the details which we shared in our previous update.    
   
Please let us know if you have any concerns about this. 
 
Regards, 
Sowmiya Loganathan 



HA Harisankar June 10, 2020 01:18 PM UTC

OK Thanks for your reply

Loader.
Up arrow icon