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

 

使用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

转载于:https://www.cnblogs.com/b400800/archive/2012/12/26/2834114.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值