Search code examples
vb.netabcpdf

ABCPDF.Net 8.0 not displaying the PDF


I am getting a blank PDF page when I print to the page.

Here is the part of my code

    Dim theURL, theID
    Dim i
    Dim strSubject, strBody
    Dim strAttach
Dim thedoc As New Doc
theDoc.HtmlOptions.Engine=EngineType.Gecko

    'Set minimum number of items a page of HTML should contain. 
    ' Otherwise the page will be assumed to be invalid.
    thedoc.HtmlOptions.ContentCount = 20
    ' Try to obtain html page 10 times
    thedoc.HtmlOptions.RetryCount = 10
    ' The page must be obtained in less then 20 seconds
    thedoc.HtmlOptions.Timeout = 20000
    'On Error Resume Next
    thedoc.Rect.Inset(1, 1)
    thedoc.Page = thedoc.AddPage()
    theURL = _URL & "&xxx=" & now()
    theID = thedoc.AddImageUrl(theURL)
    ........
    ........
    ........
    ........
    Dim theData
    theData = thedoc.GetData()
    Response.ContentType = "application/pdf"
    Response.AddHeader("content-length", theData.Length.ToString())
    Response.AddHeader("content-disposition", "inline; filename=print.pdf")
    Response.BinaryWrite(theData)
    thedoc.Clear()
    thedoc = Nothing

Please help. I cant solve the problem. Have searched google and running out of ideas. Do i need to install the latest version of Adobe acrobat?


Solution

  • What version of ABCPDF are you using? IE9 breaks ABCPDF 7 and Below. So either uninstall IE9 or Upgrade to ABCPDF 8.

    Hope this helps.