如何用指令將文件列印至檔案? |
答題得分者是:william
|
channel
尊榮會員 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
各位前輩:
小弟目前使用CutePDF的Driver透過列印將文件轉成PDF,小弟希望透過程式直接指定轉出PDF的檔名及路徑,不需跳出另存新檔(PDF)的畫面,不知要如何做?…敬請指教,感激不盡…
小弟目前的作法:
ShellExecute(0, 'print', 'C:\abc.doc', 'CutePDF Writer', 'C:\abc.pdf', SW_HIDE);
使用上述指令,仍然會跳出另存新檔(PDF)的畫面,希望直接將abc.doc檔案透過CutePDF Writer直接轉成abc.pdf檔,不需讓使用者選擇路徑及輸入檔名再按存檔鈕…各位大大幫幫小弟的忙吧…感激不盡…
------
~小弟淺見,參考看看~ |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
A quick search: You CANNOT bypass the dialog unless you pay for it (the Custom edition). http://www.cutepdf.com/Support/faq.asp#Writer
|
領航天使
站長 發表:12216 回覆:4186 積分:4084 註冊:2001-07-25 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
Another method: 1) install a postscript printer (my favorite: Apple LaserWriter)
2) print to a postscript file using the printer
3) use ghostscript (command line) to convert the ps file to pdf (CutePDF is using too....) 發表人 - william 於 2004/04/01 11:55:11
|
channel
尊榮會員 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: A quick search: You CANNOT bypass the dialog unless you pay for it (the Custom edition). http://www.cutepdf.com/Support/faq.asp#Writerwilliam大大: 感謝您的回應… 小弟了解…小弟想說可以Free使用…小弟想太多了… <>< face="Verdana, Arial, Helvetica">引言: 若真的有商業用途最好購買正式版的cutepdf 不然就考慮自己丟入鍵盤的按鍵碼給cutepdf 請參考這幾篇 http://delphi.ktop.com.tw/quicksearch.exe/quicksearch?SearchStr=Áä½L ¼ÒÀÀ 天使大大: 感謝您的回應,小弟研究看看…不過好像有點難… <>< face="Verdana, Arial, Helvetica">引言: Another method: 1) install a postscript printer (my favorite: Apple LaserWriter) 2) print to a postscript file using the printer 3) use ghostscript (command line) to convert the ps file to pdf (CutePDF is using too....) william大大: 再次感謝您的回應… 您所提供的方法,小弟不太懂耶…
------
~小弟淺見,參考看看~ |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
Ghostscript can convert postscript file into pdf, FREE. You can find a batch file 'ps2pdf.bat' in ghostscript. In order to create a postscript file, you need a postscript printer and do a print to file using that printer. Apple LaserWriter is probably the first postscript printer in the world
|
channel
尊榮會員 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: Ghostscript can convert postscript file into pdf, FREE. You can find a batch file 'ps2pdf.bat' in ghostscript. In order to create a postscript file, you need a postscript printer and do a print to file using that printer. Apple LaserWriter is probably the first postscript printer in the world >>< face="Verdana, Arial, Helvetica"> william大大: 小弟真是不材…可否舉個例子…(印表機名稱是:Lexmark Color 4079 plus PS) 1)將C:\test.doc轉C:\test.ps,指令如何下? 2)將C:\test.ps轉C:\test.pdf,指令如何下? 感激不盡…
------
~小弟淺見,參考看看~ |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
1) Replace the parameter 'CutePDF Writer' with you printer name.
2) Using ShellExecute, CreateProcess, WinExec or whatever method execute ps2pdf, e.g. 'ps2pdf c:\test.ps c:\test.pdf'. BTW, ps2pdf likes the current directory being changed to its own directory before execution.
|
channel
尊榮會員 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: 1) Replace the parameter 'CutePDF Writer' with you printer name. 2) Using ShellExecute, CreateProcess, WinExec or whatever method execute ps2pdf, e.g. 'ps2pdf c:\test.ps c:\test.pdf'. BTW, ps2pdf likes the current directory being changed to its own directory before execution.感謝William大大,一直幫小弟的忙,我看我還是放棄了,因為我執行ShellExecute(0, 'print', 'E:\abc.doc', 'Lexmark Color 4079 plus PS', 'E:\abc.ps', SW_HIDE);還是一樣會出現另存新檔的畫面…又回到原先的問題,還是花點錢買一下CutePDF…
------
~小弟淺見,參考看看~ |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
Oh.. I think your ShellExecute parameter is incorrect... 'printto' instead of 'print'. Anyway it seems that word don't accept command line option for the output file. Perhaps you should use Ole to control it? By looking at the PrintOut method in word's help, it should be possible in providing the output filename.
|
channel
尊榮會員 發表:67 回覆:707 積分:854 註冊:2002-05-02 發送簡訊給我 |
引言: Oh.. I think your ShellExecute parameter is incorrect... 'printto' instead of 'print'. Anyway it seems that word don't accept command line option for the output file. Perhaps you should use Ole to control it? By looking at the PrintOut method in word's help, it should be possible in providing the output filename.good idea… william大大:小弟已成功將word檔轉ps檔了 感激不盡… 發表人 - channel 於 2004/04/01 17:47:25
------
~小弟淺見,參考看看~ |
WhiteFang
一般會員 發表:9 回覆:23 積分:6 註冊:2002-11-22 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |