VB的源码
Public Function mnuPdf(ByVal str As String, ByVal IHwnd As Long, ByVal picName As String) As Boolean
mnuPdf = False
On Error GoTo EH
If str = "" Then
MsgBox "需要编码的数据不存在", vbInformation + vbOKOnly, "提示"
Exit Function
End If
Dim str4 As String
str4 = Decrypt(str, StrPW) '加密字符串
Dim objInput As PDFOBJ
Dim nerrcode As Integer
nerrcode = MakeStringObject(objInput, PDFINPUT, str4)
nerrcode = PDFEncode(objInput, lena(str4))
If nerrcode < 0 Then
MsgBox "Encode Error"
Exit Function
End If
Dim objOutput As PDFOBJ
Dim nOutLen As Long
Dim i As Integer
i = MakeClipboardObject(objOutput, PDFOUTPUT, IHwnd)
If PDFOutputAsDIB(DPI_100_AT_10MIL, 0) = PDF_TRUE Then
If PDFMakeImage(objOutput, nOutLen) = ERR_NOERROR Then
Dim recPDF As PDFDETAILS
If PDFGetDetails(recPDF) = PDF_TRUE Then
Const CF_DIB = 8
SavePicture Clipboard.GetData(CF_DIB), picName
End If
End If
End If
'---------------------------------------------------------------------
' End If
mnuPdf = True
Exit Function
EH:
MsgBox Err.Description
mnuPdf = False
End Function
正常运行,但无法 写bmp 文件
使用以下时,可以出现提示信息?
说明COM调用是正确的。
var
s: OleVariant;
i: Integer;
begin
s := CreateOleObject('pdfBMnew.pdfBM');
i := s.mnuPdf('', Handle, 'c: /ddd.bmp');
谢谢