Checkbox in Aspose PDF

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.

@rajasekharbatchu,

Kindly send us your source Comments Error.html file. We will investigate and share our findings with you. Your response is awaited.

I have uploaded the comments error file to the request. Also I am getting the following error while processing the huge html content with the latest ASPOSE PDF DLL. but when I use 17.2 DLL, I dont get the below error.

I cannot share the HTML content as it confidential.

Note: I believe the error is coming, in case if the HTML content is not well formed.

at Aspose.HTML.Rendering.layoutmgr.AbstractBreaker.getNextBlockListChangedIPD(LayoutContext childLC, PageBreakingAlgorithm alg, BlockSequence effectiveList)
at Aspose.HTML.Rendering.layoutmgr.AbstractBreaker.doLayout(Int32 flowBPD, Boolean autoHeight, LayoutContext parentLC)
at Aspose.HTML.Rendering.layoutmgr.PageSequenceLayoutManager.activateLayout()
at Aspose.HTML.Rendering.area.AreaTreeHandler.endPageSequence(PageSequence pageSequence)
at Aspose.HTML.Rendering.fo.dom.impl.FODocumentRenderer.Process(IFONode node)
at Aspose.HTML.Rendering.fo.dom.impl.FODocumentRenderer.Process(IFONode node)
at Aspose.HTML.Rendering.fo.dom.impl.FODocumentRenderer.Render(FODocument document)
at Aspose.HTML.Rendering.ApsAdapter.ApsAdapter.ConvertToAps(RenderingOptions options, XslFoParserOptions xslFoParserOptions, Document document)
at Aspose.HTML.Services.ApsRendererService.PreparePages(Document document, Object renderingOptions)
at Aspose.HTML.Rendering.HTMLRenderer.Render(IDevice device, Document document)
at .[1](Stream [1], Document


, HtmlLoadOptions , IList`1, String , Page&
)
at Aspose.Pdf.HtmlFragment.[1](Page [1], Double


, Double , Double, IList`1 )
at Aspose.Pdf.HtmlFragment.[1](Double& [1], Double&


, Boolean , Double, Double , List`1
, Page , MarginInfo [1] , Table


)
at .()
at Aspose.Pdf.Page.


(Page [1])
at Aspose.Pdf.Document.ProcessParagraphs()

Comments Error.zip (204 Bytes)

@rajasekharbatchu,

We managed to replicate the problem of missing checkbox in our environment. It has been logged under the ticket ID PDFNET-43816 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

We request you please share each problematic document in the form of the complete use case. We receive documents for testing purposes only, and do not share anywhere publicly. You can send confidential documents through a private message.

Do you have update for the request???

@rajasekharbatchu,

The linked ticket ID PDFNET-43816 is pending for the analysis. Our product team will investigate as per their development schedules. We will let you know once a significant progress has been made in this regard.