0

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?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
dogwasstar
  • 852
  • 3
  • 16
  • 31

2 Answers2

0

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.

Ody
  • 2,012
  • 4
  • 25
  • 35
0

There's a troubleshooting guide for this issue here on WebSupergoo's support page:

6.7 - When I convert HTML I get an empty PDF...

Blank ouput from rendering a URL can have many causes. It's not uncommon to encounter security issues, but it could also be due to network issues, firewalls, DNS, caches, etc. So it's not possible to simply guess what might be wrong. You'll find the fastest way to solve this or narrow down the problem is to work through the troubleshooter.

ABCpdf doesn't actually make use of Acrobat, so it's unlikely that upgrading Acrobat will fix the issue.

AffineMesh
  • 1,025
  • 8
  • 14
  • I have fixed it. There was a problem in my code. Thanks for your help. The binarywrite line was causing the isseue. – dogwasstar Jul 27 '11 at 23:25