Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

HTML To PDF

$
0
0
All, 

We trying to save an ASP.NET page to PDF using the following code, but the text is cut off on the right.  We are using .NET 4.0, Visual Studio 2013, Aspose.Pdf version 7.8.

Any ideas?

Private Sub Page_LoadComplete(sender As Object, e As EventArgs) Handles Me.LoadComplete    Try        'Get HTML of the page        Dim oStringWriter As New StringWriter()        Dim oHtmlTextWriter As New HtmlTextWriter(oStringWriter)        Render(oHtmlTextWriter)        ' Instantiate an object PDF class        Dim pdf As Aspose.Pdf.Generator.Pdf = New Aspose.Pdf.Generator.Pdf()        ' add the section to PDF document sections collection        Dim section As Aspose.Pdf.Generator.Section = pdf.Sections.Add()        ' Create text paragraphs containing HTML text        'Dim text2 As Aspose.Pdf.Generator.Text = New Aspose.Pdf.Generator.Text(section, oHtmlTextWriter.InnerWriter.ToString())        Dim txt As Aspose.Pdf.Generator.Text = New Aspose.Pdf.Generator.Text(oHtmlTextWriter.InnerWriter.ToString())        txt.IsHtmlTagSupported = True        txt.WrapLines = 0        txt.IsFitToPage = True        section.Paragraphs.Add(txt)        ' enable the property to display HTML contents within their own formatting        'text2.IsHtmlTagSupported = True        'text2.WrapLines = 30000        ' Add the text object containing HTML contents to PD Sections        'section.Paragraphs.Add(text2)        ' Save the pdf document        pdf.Save("Export.pdf", Generator.SaveType.OpenInBrowser, Response)    Catch ex As Exception        Console.WriteLine(ex.Message)    End TryEnd Sub

Viewing all articles
Browse latest Browse all 3131

Trending Articles