2013-03-12
更多 →
2012-11-26
更多 →
2012-11-06

由于linux上处理word和ppt比较麻烦,而且有文件格式专利的问题,所以以下操作全部在Windows下面进行。

首先需要安装Microsoft Save as PDF加载项,官方下载地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=7

安装成功后可以手工将文档另存为pdf。

需要引用“Win32::OLE”模块

use Win32::OLE;
use Win32::OLE::Const 'Microsoft Word';
use Win32::OLE::Const 'Microsoft PowerPoint';

word转pdf:

sub word2pdf{
    my $word_file = $_[0];
    my $word = CreateObject Win32::OLE 'Word.Application' or die $!;
    $word->{'Visible'} = 0;
    my $document = $word->Documents->Open($word_file) || die("Unable to open document ") ; 
    my $pdffile = $word_file.".pdf";
    $document->saveas({FileName=>$pdffile,FileFormat=>wdExportFormatPDF});
    $document -> close ({SaveChanges=>wdDoNotSaveChanges});
    $word->quit();
}

ppt转pdf

sub ppt2pdf{
    my $word_file = $_[0];
    my $word = CreateObject Win32::OLE 'PowerPoint.Application' or die $!;
    $word->{'Visible'} = 1;
    my $document = $word->Presentations->Open($word_file) || die("Unable to open document ") ; 
    my $pdffile = $word_file.".pdf";
    $document->saveas($pdffile,32);
    $document -> close ({SaveChanges=>wdDoNotSaveChanges});
    $word->quit();
}
更多 →
2012-10-09
更多 →
2012-08-06
更多 →
2012-07-23

W3C和WHATWG这两个当前负责HTML开发的组织对于标准分裂在一定程度上达成了初步共识,意味着未来将有两个版本的HTM5——“snapshot”版本和“living standard”版本。

更多 →
2012-06-28
更多 →
2012-05-31
更多 →
2012-05-18
更多 →
2012-04-26
更多 →