现在的位置: 首页 > 综合 > 正文

asp把指定网址的内容生成为PDF文件ABCPDF asp 生成pdf

2013年01月10日 ⁄ 综合 ⁄ 共 1026字 ⁄ 字号 评论关闭

 

使用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并自动分页代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%@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生成成功!")
%>

生成指定文字的代码:

1
2
3
4
5
<%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

抱歉!评论已关闭.