导航:首页 > 文档加密 > docspdf

docspdf

发布时间:2023-01-31 23:40:10

Ⅰ 如何把word文档转化成pdf格式

如果你需要把Word文档转换成PDF格式的话,其实方法有很多,电脑上有很多种方法都可以将Word文档转换成PDF格式,有专门的在线网站可以转换,也有专业的软件进行转换。

以上就是把Word文档转换成PDF格式的操作方法,希望对你有所帮助。

java代码doc转pdf提高效率的方法

使用了jacob.jar来调用activex控件,本机需安装WPS或pdfcreator
001 package experiments;
002
003 import com.jacob.activeX.ActiveXComponent;
004 import com.jacob.com.Dispatch;
005 import com.jacob.com.DispatchEvents;
006 import com.jacob.com.Variant;
007 import java.io.File;
008 import java.util.logging.Level;
009 import java.util.logging.Logger;
010
011 public class Doc2Pdf {
012
013 public static Converter newConverter(String name) {
014 if (name.equals("wps")) {
015 return new Wps();
016 } else if (name.equals("pdfcreator")) {
017 return new PdfCreator();
018 }
019 return null;
020 }
021
022 public synchronized static boolean convert(String word, String pdf) {
023 return newConverter("pdfcreator").convert(word, pdf);
024 }
025
026 public static interface Converter {
027
028 public boolean convert(String word, String pdf);
029 }
030
031 public static class Wps implements Converter {
032
033 public synchronized boolean convert(String word, String pdf) {
034 File pdfFile = new File(pdf);
035 File wordFile = new File(word);
036 ActiveXComponent wps = null;
037 try {
038 wps = new ActiveXComponent("wps.application");
039 ActiveXComponent doc = wps.invokeGetComponent("Documents").invokeGetComponent("Open", newVariant(wordFile.getAbsolutePath()));
040 doc.invoke("ExportPdf", new Variant(pdfFile.getAbsolutePath()));
041 doc.invoke("Close");
042 doc.safeRelease();
043 } catch (Exception ex) {
044 Logger.getLogger(Doc2Pdf.class.getName()).log(Level.SEVERE, null, ex);
045 return false;
046 } catch (Error ex) {
047 Logger.getLogger(Doc2Pdf.class.getName()).log(Level.SEVERE, null, ex);
048 return false;
049 } finally {
050 if (wps != null) {
051 wps.invoke("Terminate");
052 wps.safeRelease();
053 }
054 }
055 return true;
056 }
057 }
058
059 public static class PdfCreator implements Converter {
060
061 public static final int STATUS_IN_PROGRESS = 2;
062 public static final int STATUS_WITH_ERRORS = 1;
063 public static final int STATUS_READY = 0;
064 private ActiveXComponent pdfCreator;
065 private DispatchEvents dispatcher;
066 private volatile int status;
067 private Variant defaultPrinter;
068
069 private void init() {
070 pdfCreator = new ActiveXComponent("PDFCreator.clsPDFCreator");
071 dispatcher = new DispatchEvents(pdfCreator, this);
072 pdfCreator.setProperty("cVisible", new Variant(false));
073 pdfCreator.invoke("cStart", new Variant[]{newVariant("/NoProcessingAtStartup"), new Variant(true)});
074 setCOption("UseAutosave", 1);
075 setCOption("UseAutosaveDirectory", 1);
076 setCOption("AutosaveFormat", 0); // 0 = PDF
077 defaultPrinter = pdfCreator.getProperty("cDefaultPrinter");
078 status = STATUS_IN_PROGRESS;
079 pdfCreator.setProperty("cDefaultprinter", "PDFCreator");
080 pdfCreator.invoke("cClearCache");
081 pdfCreator.setProperty("cPrinterStop", false);
082 }
083
084 private void setCOption(String property, Object value) {
085 Dispatch.invoke(pdfCreator, "cOption", Dispatch.Put, new Object[]{property, value}, new int[2]);
086 }
087
088 private void close() {
089 if (pdfCreator != null) {
090 pdfCreator.setProperty("cDefaultprinter", defaultPrinter);
091 pdfCreator.invoke("cClearCache");
092 pdfCreator.setProperty("cPrinterStop", true);
093 pdfCreator.invoke("cClose");
094 pdfCreator.safeRelease();
095 pdfCreator = null;
096 }
097 if (dispatcher != null) {
098 dispatcher.safeRelease();
099 dispatcher = null;
100 }
101 }
102
103 public synchronized boolean convert(String word, String pdf) {
104 File pdfFile = new File(pdf);
105 File wordFile = new File(word);
106 try {
107 init();
108 setCOption("AutosaveDirectory", pdfFile.getParentFile().getAbsolutePath());
109 if (pdfFile.exists()) {
110 pdfFile.delete();
111 }
112 pdfCreator.invoke("cPrintfile", wordFile.getAbsolutePath());
113 int seconds = 0;
114 while (isInProcess()) {
115 seconds++;
116 if (seconds > 30) { // timeout
117 throw new Exception("convertion timeout!");
118 }
119 Thread.sleep(1000);
120 }
121 if (isWithErrors()) return false;
122 // 由于转换前设置cOption的AutosaveFilename不能保证输出的文件名与设置的相同(pdfcreator会加入/修改后缀名)
123 // 所以这里让pdfcreator使用自动生成的文件名进行输出,然后在保存后将其重命名为目标文件名
124 File outputFile = newFile(pdfCreator.getPropertyAsString("cOutputFilename"));
125 if (outputFile.exists()) {
126 outputFile.renameTo(pdfFile);
127 }
128 } catch (InterruptedException ex) {
129 Logger.getLogger(Doc2Pdf.class.getName()).log(Level.SEVERE, null, ex);
130 return false;
131 } catch (Exception ex) {
132 Logger.getLogger(Doc2Pdf.class.getName()).log(Level.SEVERE, null, ex);
133 return false;
134 } catch (Error ex) {
135 Logger.getLogger(Doc2Pdf.class.getName()).log(Level.SEVERE, null, ex);
136 return false;
137 } finally {
138 close();
139 }
140 return true;
141 }
142
143 private boolean isInProcess() {
144 return status == STATUS_IN_PROGRESS;
145 }
146
147 private boolean isWithErrors() {
148 return status == STATUS_WITH_ERRORS;
149 }
150
151 // eReady event
152 public void eReady(Variant[] args) {
153 status = STATUS_READY;
154 }
155
156 // eError event
157 public void eError(Variant[] args) {
158 status = STATUS_WITH_ERRORS;
159 }
160 }
161
162 public static void main(String[] args) {
163 convert("e:\\test.doc", "e:\\output.pdf");
164 }
165 }

Ⅲ 怎么将word文档转换成pdf

转换方式有以下两种。

一、通过另存为PDF格式。

  1. 打开需要转换格式的文档,点击左上角的图标;

  2. 选择 另存为 — PDF格式;

  3. 命名及选择存储位置,然后点击确定即可。

Ⅳ 怎么从word转换成pdf

PDF格式良好的视觉阅读性和通用性使得PDF文件的使用越来越广泛了,网络上的PDF资料也越来越多,
pdf一般是不可以随意修改的,
主要是用于阅读的。
但是有时我们想要修改编辑,
Word怎样转换成PDF呢?
这里我们讲解Word转换PDF方法,
我提供几个方法,
请根据合适的情况进行选择。

1、Microsoft Office 2010 、WPS Office 2010环境

怎么把word转成pdf?在Word 2010、WPS Office可以直接另存Word文档为PDF,支持中文,兼容性能够保证。

Office 2010中另存Word为PDF(快捷键为F12):

WPS 2010输出为PDF:

2、Microsoft Office 2007环境

Office 2007中word转换PDF的方法也很简单,只需安装一个加载项,就能导出文件并将其保存为PDF和XPS格式。

2007 Microsoft Office加载项:Microsoft Save as PDF 或 XPS

补充说明:Office 2007 with SP2已经内置Save As PDF/XPS支持。

3、Microsoft Office 2003环境

Office 2003需要PDF虚拟打印机的支持,安装虚拟打印机后,选择文件->打印,在打印机列表中选择PDF虚拟打印机,即可输出为PDF。

推荐的虚拟打印机:TinyPDF、PDFCreator或Foxit PDF Creator。

4、未安装MS Office环境的情况

如果没有安装任何Office软件,可以使用SoftMaker Viewer,这是一款多功能Word文档阅读工具,可直接将文档输出为PDF文件。

5、利用在线应用

比如上传到Google Docs,然后下载为PDF。

编后语:以上便是Word怎样转换成PDF的几种方法,最简单实用的就是直接在word另存为pdf格式,一般简历会存为pdf格式,以免被别人修改或复制的问题,用PDF阅读更加有读书的感觉。pdf的应用也越来越广泛,传统的读书模式渐渐减少。

Ⅳ word转换成pdf乱码怎么办

word转换成pdf乱码出现的原因:
word含特殊字符,而pdf不存在该字符集,比如word是繁体的,而pdf没有装繁体库,显示不了繁体,从而出现乱码。
解决方法:
出现这种情况,直接对乱码的pdf文件是无法处理让其正常显示的,只能换其他的转换方式,对word文档重新进行转换,下面推荐几种出现乱码几率较低的转换方法。
1、使用Word
2010、2007可以直接另存Word文档为PDF,支持中文,一般不会出现乱码的情况。
2、使用wps2010和2012将word转换成pdf出现乱码的几率也比较低,直接点击【文件】【输出pdf】就可以了。
3、上传到Google
Docs,然后下载为PDF,一般也不会出现乱码的情况。

Ⅵ Docs PDF/PowerPoint Viewer这个插件怎么用的

Powerpoint viewer 是专门阅读PPT文件的阅读工具,只能查看,不能编辑。

1,使用 PowerPoint Viewer,可以完全逼真地查看在 PowerPoint 97 或更高版本中创建的功能齐备的演示文稿。 此查看器还支持打开受密码保护的 Microsoft PowerPoint 演示文稿。 在 PowerPoint Viewer 中可以查看和打印演示文稿,但是不能编辑它们。
2,可以使用 PowerPoint Viewer 附带的字体进行显示和打印,但是显示和打印的内容必须来自运行 Microsoft Windows 操作系统的设备。

Ⅶ 如何把word文档转化成pdf格式

将word文件转换成pdf格式的方法很多,主要有两类。一类是使用软件,另外一类则是在线的工具(Do
it
online)。
首先,常使用的软件有:
1.
Adobe
Reader自带的pdf转换功能,可以创建一个新的pdf文档,或者将word文件或其他格式的文件如.ppt
,.html等转换成pdf,一般安装Adobe
Reader之后,它会自动整合到office中去,在office的工具栏上就有转化的图标。
2.
PrimoPDF
(网址:http://www.primopdf.com/)
Completely
free
PDF
creator
-
Create
PDF
files
from
300+
file
types.
Make
100%
instry-standard
PDF
from
any
files
that
print.
Create
PDF
files
optimized
for
print,
screen,
ebook,
or
prepress.
3.
pdfMachine
White
可以把Windows应用软件的打印数据流转换成PDF文件。为生成PDF文件,使用者只需在
应用软件的打印对话框中选择pdfMachine驱动程序即可。
下载地址:http://www.pdfmachine.com/pdfmachine/download.shtml
4.
SolidConventerPDF
可以google一下,网上很多资源的。
5.
WPS
因为大家用微软的office太多了,很少有人使用WPS,但是WPS中就有一项是可以将其文件格式转换成PDF的,很方便。
在线的工具包括:
1.
Google
Docs
(谷歌文档)
在谷歌主页上选择Google文档,进入之后,将你的word文档上传或者复制粘贴到一个新建的documents中,然后选择“下载另存方式”(downloads
as)可以保存成PDF格式或者RTF,word,html,openoffice。
2.
http://online.primopdf.com/
只要输入你的邮箱,并将需要转换格式的文件上传,很快就可以在你的邮箱中看到已经转换好格式的文件了。
3.
http://12.36.119.143/doc2pdf/convert_pdf.aspx
同样是一个在线的服务。

阅读全文

与docspdf相关的资料

热点内容
linux源代码导读 浏览:701
百战程序员6000集下载 浏览:145
苹果和安卓手机之间怎么克隆 浏览:464
模糊聚类算法研究 浏览:107
宝德服务器硬盘亮红灯如何解决 浏览:695
androidlibgdx下载 浏览:408
联盟pdf下载 浏览:792
南通住房公积金app支取银行怎么填 浏览:680
韩国剧情电影男主自杀2次是什么电影 浏览:646
李彩谭电影全部 浏览:703
范伟乔杉电影叫什么名字 浏览:467
中国十大免费电影网站 浏览:509
一富豪请两个女的的电影 浏览:701
如何云服务器搭建游戏 浏览:561
魔兽猎人宏命令 浏览:433
翁虹电影大全 浏览:990
如何把文件夹改变为安装包 浏览:299
地震勘探pdf 浏览:690
c语言怎样给字符串加密 浏览:583
什么网站可以看剧情 浏览:533