加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

OLE打印PDF(Perl)

发布时间:2020-12-16 00:43:29 所属栏目:大数据 来源:网络整理
导读:跟ABAP没有什么关系。只是可以说明OLE提供了转PDF的处理方式。 Printing PDF files using Win32::OLE and Acrobat Exchange Posted by Domenico Discepola on July 15,2004,3:56 pm Hello.??My goal is to print Adobe PDF files from a Perl script without

跟ABAP没有什么关系。只是可以说明OLE提供了转PDF的处理方式。

Printing PDF files using Win32::OLE and Acrobat Exchange

Posted by Domenico Discepola on July 15,2004,3:56 pm
Hello.??My goal is to print Adobe PDF files from a Perl script without any
user intervention.??I have been experimenting with various methods and am
now trying to use Win32::OLE to control Adobe Acrobat Exchange (v5.0.5).
Please refer to the code below.??I can create the acrobat object,open the
document and retrieve some information from the document.??My problems are:

1. Although I make acrobat visible using the show method,only the
application becomes visible,not the document.??How do I fix this?

2. What is the method to print the document once it has been opened???The
"PrintPagesEx" method produces an error "Win32::OLE 0.1701) error
0x80020003: "Member not found" in METHOD/PROPERTYGET "" at jps2.pl line 30".
I then tried to loop through the hash referenced by the $doc variable but no
output from the hash was printed.

3. As an aside,if someone can provide me with the class name for Acrobat
Reader (not Acrobat exchange,as I have coded below) that would be great (or
inform me how to find it).??I am relatively inexperienced in the world of
OLE Automation so any hints would be helpful.


##############
#!perl
use strict;
use warnings;
use diagnostics;
use Win32::OLE;
use Win32::OLE::Const "Acrobat";
our $g_file_input = shift @ARGV;
die "Usage: $0 filenamen" unless $g_file_input;

sub process_main {


?#This does not work



}

sub main {
?print "PDF programn";
?&process_main();
?print "Ending nown";
}

&main();
exit 0;
###############

Posted by Matt Garrish on July 15,8:43 pm


(or


4.1 Differences Among the Acrobat Viewers

Acrobat supports all of the OLE automation methods
listed in this chapter.

The Acrobat Reader does not support OLE automation.


For more info: http://partners.adobe.com/asn/acrobat/docs/iacovr.pdf

(And I don't have Exchange,so I can't help you with the rest.)

Matt

?

--------

?

Success!??Here is the code that opens up and prints a PDF using Win32::OLE
and Acrobat Exchange (v5.0.5 is the version I have).??Thanks for the link to
Acrobat Exchange's OLE Objects and Methods.??Too bad that Acrobat Reader
doesn't support OLE automation - I'm sure more people could have benefited
from this.

######################
#!perl
use strict;
use warnings;
use diagnostics;
use Win32::OLE;
use Win32::OLE::Const "Acrobat";
our $g_file_input = shift @ARGV;
die "Usage: $0 filenamen" unless $g_file_input;

sub process_main {

?}
?print "Num pages: $ppn";

} sub main { ?print "PDF programn"; ?&process_main(); ?print "Ending nown"; } &main(); exit 0;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读