jrgf 发表于 2017-5-18 10:29:05

perl-word转成pdf

  #word转成pdf
  #程序:刘兴
#时间:2010.3.19
#blog:http://deepfuture.iteye.com
#QQ:782322192
  use warnings;
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Word';
my $word = CreateObject Win32::OLE 'Word.Application' or die $!;
  #作者blog:http://deepfuture.iteye.com/
$word->{'Visible'} = 1;
my $document = $word->Documents->Open('D:\深未来\测试\xxx.doc');
my $pdffilename = 'D:\深未来\测试\xxx.pdf';
$document->saveas({FileName=>$pdffilename,FileFormat=>wdExportFormatPDF});
$word->quit();
  作者blog:http://deepfuture.iteye.com/
页: [1]
查看完整版本: perl-word转成pdf