2011-05-24 58 views
0

當我打印到頁面時,我得到一個空白的PDF頁面。ABCPDF.Net 8.0不顯示PDF

這裏是我的代碼的一部分

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 

請幫助。我無法解決問題。已經搜索谷歌和用盡想法。我是否需要安裝最新版本的Adobe Acrobat?

回答

0

您使用的是什麼版本的ABCPDF? IE9打破ABCPDF 7及以下版本。所以要麼卸載IE9或升級到ABCPDF 8.

希望這會有所幫助。

0

有針對此問題的故障排除指南這裏WebSupergoo的支持頁面上:

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

從渲染URL可以有許多原因空白輸出中。遇到安全問題並不罕見,但也可能是由於網絡問題,防火牆,DNS,緩存等原因造成的。因此,不可能簡單地猜出可能出現的問題。你會發現解決這個問題的最快方法或縮小問題的方法是通過故障排除工作。

ABCpdf實際上並未使用Acrobat,因此升級Acrobat不太可能解決此問題。

+0

我修復了它。我的代碼有問題。謝謝你的幫助。二進制寫入行導致isseue。 – dogwasstar 2011-07-27 23:25:22