ASP 导成PDF

ccjjww1222 2009-01-04 11:36:24
把数据库里面的数据 现在页面上显示(已实现)
然后导出PDF 并且保存
谁做过 给个例子 谢谢啦
...全文
132 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
勿说心想 2010-09-11
  • 打赏
  • 举报
回复
kanbudong
ccjjww1222 2009-01-04
  • 打赏
  • 举报
回复
服务器是自己的 可以使用组件
layers2323 2009-01-04
  • 打赏
  • 举报
回复
在没有组件情况下,asp好像不能像导出excel那样导出pdf吧。
明珠佩佩 2009-01-04
  • 打赏
  • 举报
回复
可以研究下PDF的SDK,里面有相关的使用例子

附上添加签名的代码

/*********************************************************************

ADOBE SYSTEMS INCORPORATED
Copyright (C) 1998-2004 Adobe Systems Incorporated
All rights reserved.

NOTICE: Adobe permits you to use, modify, and distribute this file
in accordance with the terms of the Adobe license agreement
accompanying it. If you have received this file from a source other
than Adobe, then your use, modification, or distribution of it
requires the prior written permission of Adobe.

---------------------------------------------------------------------

sdkAddSignature.js

- Folder level Acrobat JavaScript file.

*********************************************************************/


/** sdkAddSignature.js
Folder Javascript Created by Acrobat SDK.

This JavaScript sample shows you can programmatically sign a PDF document using
your digital ID file.

As a sample, this file has included all the digital signature information
except the path and password for the digital ID file to be used.
When you are ready to sign a PDF, click the newly added "Add My Signature"
menu item under the tool menu. After you input the platform independent path and
the password through a dialog, the program will create a digital
signature field in the top-left corner, and sign it with your data. The path
and password are valid in a Acrobat session, so you can continue to sign more
documents in the session without the input dialogs.
If you change the code to specify the path and password for the digital ID
file to be used in this file, then when you click the menu item, the program will
go automatically to sign PDFs without UI.

Using the function SetUserPassword() and function SetUserDigitalIDPath() in this
folder JavaScript code, you can call the JavaScript to quietly sign a PDF from other
JavaScript code, or from a plug-in or IAC VB or VC program through function
ExecuteThisScript( ). The VB and C Sample code is attached in end of this file.

A digital signature file ( DrTest.pfx ) is provided with the sample for your test.
To use it, put it in a folder, and specify the proper DIpath ( e.g. /C/DrTest.pfx ).
Its password is "testpassword".
*/


// password to use the digital signature
var sigUserPwd = "UNKNOWN";
// to test the sample without user input, specify:
// var sigUserPwd = "testpassword";

// path to the digital signature file
var sigDigitalIDPath = "UNKNOWN";
// to test the sample without user input, specify:
//var sigDigitalIDPath = "/C/DrTest.pfx";

// other variables the user can modify
var sigHandlerName = "Adobe.PPKLite";
var sigFieldname = "sdkSignatureTest";
var sigReason = "I want to test my digital signature program.";
var sigLocation = "San Jose, CA";
var sigContactInfo = "sendme@testinc.com";


/* Add a menu item for AddSignature */
app.addMenuItem( { cName: "ADBESDK:AddSignature", cUser: "Add My Signature", cParent: "Advanced",
cEnable: "event.rc = (event.target != null);",
cExec: "AddSignature(event.target)" });


// main function
function AddSignature(doc)
{
// if sigDigitalIDPath is not spcified, ask for user input
if(sigDigitalIDPath == "UNKNOWN"){
var cResponse = app.response({
cQuestion: "Input your digital ID path:",
cTitle: "Digital Signature",
cDefault: "/C/DrTest.pfx",
});

if ( cResponse == null) {
app.alert("No input.");
return;
}
else
SetUserDigitalIDPath(cResponse);
}

// if sigUserPwd is not spcified, ask for user input
if(sigUserPwd == "UNKNOWN"){
var cResponse = app.response({
cQuestion: "Input your password:",
cTitle: "Digital Signature",
cDefault: "testpassword",
});

if ( cResponse == null) {
app.alert("No input.");
return
}
else
SetUserPassword(cResponse);
}

// create a new signature field
var signatureField = AddSignatureField(doc);

// sign it
if(signatureField) Sign(signatureField, sigHandlerName);
}



// create a signature field in the upper left conner with name of sigFieldname
function AddSignatureField(doc)
{
var inch=72;
var aRect = doc.getPageBox( {nPage: 0} );
aRect[0] += 0.5*inch; // from upper left hand corner of page.
aRect[2] = aRect[0]+2*inch; // Make it 2 inch wide
aRect[1] -= 0.5*inch;
aRect[3] = aRect[1] - 0.5*inch; // and 0.5 inch high

var sigField = null;
try {
sigField = doc.addField(sigFieldname, "signature", 0, aRect );
} catch (e) {
console.println("An error occurred: " + e);
}

return sigField;
}

// define the Sign function as a privileged function
Sign = app.trustedFunction (
function( sigField, DigSigHandlerName )
{
try {
app.beginPriv();
var myEngine = security.getHandler(DigSigHandlerName);
myEngine.login( sigUserPwd, sigDigitalIDPath);
sigField.signatureSign({oSig: myEngine,
bUI: false,
oInfo: { password: sigUserPwd,
reason: sigReason,
location: sigLocation,
contactInfo: sigContactInfo}
});
app.endPriv
} catch (e) {
console.println("An error occurred: " + e);
}
}
);

// set a correct password for using the signature, so you can quietly sign a doc.
function SetUserPassword(pwd)
{
sigUserPwd = pwd;
}

// set path to the digital signature file
function SetUserDigitalIDPath(idPath)
{
sigDigitalIDPath = idPath;
}

/******************************************************
VB code in an Acrobat IAC program
to sign a PDF quietly ( no Acrobat running on screen ),
using the JS methods in this file
******************************************************
' .........
' At this point, a PDF file has been opened, but Acrobat may be hidden.

' get acrobat form object
Dim formApp As AFORMAUTLib.AFormApp
Set formApp = CreateObject("AFormAut.App")

' access some object property in objects inside AcroForm.
Dim fields As AFORMAUTLib.fields
Set fields = formApp.fields

' One way to use a JavaScript code in VB is through fields' method ExecuteThisJavascript.
'Dim nVersion As Integer
'nVersion = fields.ExecuteThisJavascript("event.value = app.viewerVersion;")
'MsgBox "The Acrobat Viewer Version is " & nVersion

'Sign the document
Dim menuItem As String
Dim digitalIDPwd As String
Dim digitalIDPath As String

digitalIDPwd = "testpassword"
digitalIDPath = "/C/DrTest.pfx"
menuItem = "ADBESDK:AddSignature"

Dim jsCode As String
Dim jsRc As Boolean
jsCode = "SetUserPassword(" + "'" + digitalIDPwd + "'); SetUserDigitalIDPath(" + "'" + digitalIDPath + "');" + "app.execMenuItem(" + "'" + menuItem + "');"

' Execute JS code to sign doc
fields.ExecuteThisJavascript (jsCode)

'save & close
AVDoc.Close (True)


' .........
*********************************************************************/

/******************************************************
C code in an Acrobat plug-in
to sign a PDF quietly using the JS methods in this file
******************************************************
ASBool MyCallJS(PDDoc pdDoc)
{
if(!pdDoc) return false;

char jsScript[512];
char* pwd="testpassword";
char* digitalIDPath = "/C/DrTest.pfx";
char* menuItem = "ADBESDK:AddSignature";

sprintf(jsScript, "SetUserPassword('%s'); SetUserDigitalIDPath('%s'); app.execMenuItem('%s');",
pwd, digitalIDPath, menuItem);

return AFExecuteThisScript (pdDoc, jsScript, NULL);
}

**************************************/
  • 打赏
  • 举报
回复
给个你参考一下

用asp实现Crystal Report 8.5导出到PDF问题解决
需要在服务器上做如下的动作:
安装IIS。
安装Crystal Report 8.5的开发版。开发版最多5个并发用户,在IIS下面的Crystal_Licence中可以预览到当前的并发和激活用户。
将C:\windows\crystal下面的Crxf_pdf.dll覆盖为V9.1.1.534的版本,文件更新日期为2002/7/10。此问题可以解决Export到PDF中文为乱码的问题。
至此如果用ASP开发导出的时候会出现“Unexpected Error”。那么可以用第5步来进行解决
打开Component管理,添加新的Application,设定Identity为Local Service。设定Security中的Enforce Access为不选。
添加新的Component,选择Craxdrt.dll.
导出代码:

Set session("ExportOptions") = Session("oRpt").ExportOptions
session("ExportFileName") = BasePath & sPO &".pdf"

session("ExportOptions").DiskFileName=session("ExportfileName")

session("ExportOptions").FormatType = cint(31) 'PDF

session("ExportOptions").DestinationType = 1

Session("oRpt").Export False

Session.Abandon
  • 打赏
  • 举报
回复
.net通过组件可以导出 asp好像没看到过 你可以baidu里找找
具体介绍压力传感器在使用中要注意的事项 ,希望可以帮助到大家。压力传感器在使用中要 注意的事项1.防止变送器与腐蚀性或过热的介质接触;2.防止渣滓在导管内沉积;3.测量液 体压力时,取压口应开在流程管道侧面,以避免沉淀积渣。4.测量气体压力时,取压口应开在流 程管道顶端,并且变送器也应安装在流程管道上部,以便积累的液体容易注入流程管道中。5.导 压管应安装在温度波动小的地方;6.测量蒸汽或其它高温介质时,需接加缓冲管(盘管)等冷凝 器,不应使变送器的工作温度超过极限。7.冬季发生冰冻时,按装在室外的变送器必需采取防冻 措施,避免引压口内的液体因结冰体积膨胀,导至传感器损坏。8 . 测量液体压力时,变送器的安 装位置应避免液体的冲击(水锤现象),以免传感器过压损坏。9.接线时,将电缆穿过防水接头 (附件)或绕性管并拧紧密封螺帽,以防雨水等通过电缆渗漏进变送器壳体内。压力传感器的检 测方式在使用压力传感器的时候,如何检测压力传感器显得十分重要,检测压力传感器根据目的 不同,检测的项目和方法也就会有区别。这里介绍3种压力传感器的检测方法:1、加压检测检单 的方法是:给传感器供电,用带压力表的气压源头连接传感器,用万用表的电压档检测传感器输 出端的电压变化。按照压力的大小和输出信号的变化量,对传感器进行校准。并在条件许可的情况下,进行相关参数的温度检测。2、零点的检测用万用表的电压档,检测在没有施加压力的条件 下,传感器的零点输出。这个输出一般为mV级的电压,如果超出了传感器的技术指标,就说明传 感器的零点偏差超范围。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧