使用ABCPDF可以把指定網頁中的圖片文字產生為PDF檔案。
7.0.1.1Professnional版下載網址:
http://www.3ddown.com/soft/12233.htm
標準版序號(Standard License):341-639-358
專業版序號(Professnional License):719-253-057
官方網址:
http://www.websupergoo.com
把指定網址的全部內容及圖片產生為PDF並自動分頁代碼:
123456789101112131415161718192021222324 |
<%@LANGUAGE= "VBSCRIPT" CODEPAGE= "65001" %> <% Set theDoc = Server.CreateObject( "ABCpdf7.Doc" ) theDoc.Rect.Inset 72, 144 theDoc.Page = theDoc.AddPage() theURL = "http://www.isxml.com/" '要產生的PDF源內容的網址 theID = theDoc.AddImageUrl(theURL) Do theDoc.FrameRect ' add a black border If Not theDoc.Chainable(theID) Then Exit Do theDoc.Page = theDoc.AddPage() theID = theDoc.AddImageToChain(theID) Loop For i = 1 To theDoc.PageCount theDoc.PageNumber = i theDoc.Flatten Next theDoc.Save "D:\dhtml.pdf" '儲存檔案的路徑 response.Write( "PDF產生成功!" ) %> |
產生指定文字的代碼:
12345 |
<% Set theDoc = Server.CreateObject( "ABCpdf7.Doc" ) theDoc.FontSize = 96 theDoc.AddText "Hello World" theDoc.Save "c:\mypdfs\simple.pdf" '為儲存的檔案路徑,請自行更改到IIS網站目錄裡面。 %> |
注意事項:
C:\WINDOWS\system32\ABCpdfCE7.dll
需要有寫入修改許可權另外,產生PDF用了NET Framework中的MSXML功能
我安裝的是NET Framework4.0