Free Support Forum -

Aspx to pdf just flat out does not work

I have scanned your message boards and your documentation and found that this is the recommended solution (VB)

Pdf = New Aspose.Pdf.Pdf
Dim surl As String = Request.Url.ToString()
Dim webClient As System.Net.WebClient = New System.Net.WebClient()
webClient.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim myDataBuffer() As Byte = webClient.DownloadData(MyURL.AbsoluteUri)
Dim postStream As MemoryStream = New MemoryStream(myDataBuffer)
'Set Font Map for better performance
pdf.IsTruetypeFontMapCached = True
pdf.TruetypeFontMapPath = System.IO.Path.GetTempPath()

the above includes credentials which is needed as this is a .net 2.0 password-protected site. The problem is that the above produces a 500 server error. Please respond. I urgently need this to work as advertised.


Please use the BindHTMLFromUrl ( method with the Credentials ( field.