Hi,
I have few checkboxes which are generating with HTML content in to the PDF. Unfortunately when I generate a PDF with greater than 17.2(Aspose PDF DLL Version) the checkbox are missing from the PDF. Also the checkbox position is jumping here and there, its not as the
Code is as below:
public void GeneratePDFFromHTML()
{
string basePath = @"C:\Raj\";
var dataDir = AppDomain.CurrentDomain.BaseDirectory;
var lic = new Aspose.Pdf.License();
lic.SetLicense("Aspose.Pdf.lic");
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
// Load HTML file
var htmlContent = System.IO.File.ReadAllText(basePath + "Comments Error.html");
Document doc = new Document();
var commentsData = new HtmlFragment(htmlContent);
var page = doc.Pages.Add();
page.Paragraphs.Add(commentsData);
var checkbox = new HtmlFragment("<div><input type='checkbox' checked='checked'/><strong>Hi Raj</strong> <span style='color:#2E74B5;'>How are you doing, this is a sample text for placing a checkbox in the pdf page</span></div>");
page.Paragraphs.Add(checkbox);
//doc.ProcessParagraphs();
// Save HTML file
doc.Save(basePath + "output.pdf");
}
Also I have attached the PDF after generated as below
ASPOSE 17.2 output.pdf (59.7 KB)
ASPOSE 17.3 output.pdf (59.9 KB)
ASPOSE 17.11 output.pdf (59.9 KB)
Comments Error.zip (204 Bytes)
Let me know the path forward. The code moved to production and users are complaining about the checkbox behaviour.
Regards,
Raj.