Html in pdf

Hi, i have html code returned from sql "
  • Penn Surgery- Division of GI Surgery " like
  • . is there a way the pdf can display a dot? i am fill the table with from a data table. here is the code Dim tableChkList As Aspose.Pdf.Table = New Aspose.Pdf.Table()

    tableChkList.ImportDataTable(dtChkList, False, 0, 0, 200, 2)

    doc.Pages(1).Paragraphs.Add(tableChkList)

    dtChkList has the record set returns from sql and one row has html code in it.

    thanks.


  • Hi Ying,


    Thanks for contacting support.

    Can you please share some details regarding the issue which you are facing. As per my understanding from above stated code, you have imported the contents of DataTable to Aspose.Pdf.Table instance. Can you please share what problem exactly you are facing ? are you unable to import the data or facing an issue while displaying data inside PDF file.

    Please share complete code and resource files so that we can test the scenario in our environment.

    Thanks for get back to me so fast.

  • is returned from sql. Can PDF “understands” html code?
  • I want to display a list. Since provider can have multiple locations.

  • Department of Emergency Medicine: 3400 Spruce Street Ground Silverstein Bldg Philadelphia PA 19104-4206
  • Penn Observation Medicine Service: 3400 Spruce Street Ground Floor Donner Philadelphia PA 19104-4206
  • UPHS/Presbyterian - Dept. of Emergency Medicine: 51 N. 39th Street . Philadelphia PA 19104-2640
  • in PDF it has

  • Department of Emergency Medicine: 3400 Spruce Street Ground Silverstein Bldg Philadelphia PA 19104-4206

    Here is how I generate PDF

    Dim sqlCmdProvider As SqlCommand = New SqlCommand("Get_ProviderInfo")

    sqlCmdProvider.Connection = m_Conn

    sqlCmdProvider.CommandType = Data.CommandType.StoredProcedure

    SqlCommandBuilder.DeriveParameters(sqlCmdProvider)

    sqlCmdProvider.Parameters("@p_dr_chk_link").Value = dr_chk_link

    Dim drProvider As SqlDataAdapter = New SqlDataAdapter(sqlCmdProvider)

    '' label value

    Dim dtProvider As DataTable = New DataTable("Provider")

    drProvider.Fill(dtProvider)

    drProvider.Dispose()

    sqlCmdProvider.Dispose()

    ' Initializes a new instance of the Table

    Dim tableProvider As Aspose.Pdf.Table = New Aspose.Pdf.Table()

    'Set column widths of the table

    tableProvider.ColumnWidths = "200 200 "

    ' Set the table border color as LightGray

    tableProvider.Border = New Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.5F, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray))

    ' set the border for table cells

    tableProvider.DefaultCellBorder = New Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.5F, Aspose.Pdf.Color.FromRgb(System.Drawing.Color.LightGray))

    Dim margin As Aspose.Pdf.MarginInfo = New Aspose.Pdf.MarginInfo()

    margin.Top = 2.5F

    margin.Left = 2.5F

    margin.Bottom = 1.0F

    tableProvider.DefaultCellPadding = margin

    tableProvider.ImportDataTable(dtProvider, False, 0, 0, 200, 2)

    doc.Pages(1).Paragraphs.Add(tableProvider)

    thanks,

    Ying

    • Department of Emergency Medicine: 3400 Spruce Street Ground Silverstein Bldg Philadelphia PA 19104-4206
    • Penn Observation Medicine Service: 3400 Spruce Street Ground Floor Donner Philadelphia PA 19104-4206
    • UPHS/Presbyterian - Dept. of Emergency Medicine: 51 N. 39th Street . Philadelphia PA 19104-2640

    there were bullet point on each location but they were gone after i posted.

    Hi Ying,


    Thanks for sharing the details and sorry for the delayed response.

    Aspose.Pdf for .NET supports the feature to render HTML text inside PDF document using HtmlSegment object however currently it does not support the feature to render HTML text inside table object. Therefore when importing database contents to PDF file, the HTML tags are not rendered accordingly. For the sake of implementation, I have
    logged this requirement in our issue tracking system under New Features list as
    PDFNEWNET-38034. We will further investigate this requirement in details
    and will keep you updated on the status of a correction.

    We apologize for your inconvenience.

    The issues you have found earlier (filed as PDFNET-38034) have been fixed in Aspose.PDF for .NET 18.5. This message was posted using BugNotificationTool by asad.ali