We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

html converted into table

hi
 
we managed with html converting , i didnt find any example of how to create custom pfdlighttable
and add for each cell the converted html
 
do you have any help about it?

1 Reply

GM Geetha M Syncfusion Team May 11, 2012 06:34 AM UTC

Hi Noam,

Thank you for your interest in Syncfusion products.

You can draw the converted HTML content in the BeginCellLayout Event of PdfLightTable. The following code snippet illustrates this:

/// <summary>

/// Convert HTML string to PDF and update.

/// </summary>

void lightTable_BeginCellLayout(object sender, BeginCellLayoutEventArgs args)

{

    if (args.RowIndex > -1)

    {

        width = unitConvertor.ConvertToPixels(args.Bounds.Width, PdfGraphicsUnit.Point);

        using (HtmlConverter converter = new HtmlConverter())

        {

            Metafile mf = (Metafile)converter.FromString(dataString[args.RowIndex], ImageType.Metafile, (int)width, -1);

            args.Graphics.DrawImage(new PdfMetafile(mf), args.Bounds);

        }

    }

}

I had placed the sample below.

Please try this and let us know if you have any questions.

Regards

Geetha



LightTable_HTML_cc867728.zip

Loader.
Live Chat Icon For mobile
Up arrow icon