pdf2swf 和pdf2html 使用命令詳解


pdf2swf 將pdf文檔轉換為flash方式閱讀,可以滿足公式、圖片的格式定義;

pdf2htmlEX 將pdf文檔轉換為html方式閱讀,有一下優點:

  • 在HTML文件中精確顯示原生文本
    • 保持PDF中的字體,顏色,位置
    • 可以選擇,復制,搜索
  • 生成的文件大小與解壓縮后的PDF文件相當,如果放到支持HTTP壓縮的服務器上,網絡消耗和PDF相當

1、pdf2swf 命令

  其中把pdf轉成swf的工具就是pdf2swf了。在命令行中運行pdf2swf src.pdf des.swf一般能滿足需求。而命令行參數可以通過pdf2swf -f得到:
-h , –help                      Print short help message and exit              打印幫助信息
-V , –version                Print version info and exit                        打印版本號
-o , –output file.swf         Direct output to file.swf. If file.swf contains ‘13568621′ (file13568630.swf), then each page指定輸出的swf文件名
-p , –pages range             Convert only pages in range with range e.g. 1-20
or 1,4,6,9-11 or

指定轉換的頁面范圍,使用的頁碼描述方法與打印機打印文件時候的選頁一樣

-P , –password password       Use password for deciphering the pdf.指定打開pdf的密碼
-v , –verbose                 Be verbose. Use more than one -v for greater effect.轉換時輸出詳細的內容
-z , –zlib                    Use Flash 6 (MX) zlib compression.使用Flash 6的zlib壓縮機制
-i , –ignore                  Allows pdf2swf to change the draw order of the pdf. This may make the generated允許程序修改pdf的繪制順序,可能會導致結果與原來有差異
-j , –jpegquality quality     Set quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)設置轉換其中的jpeg圖片的質量,從0到100,默認值是85。
-s , –set param=value         Set a SWF encoder specific parameter.  See pdf2swf -s help for more information.  設置SWF轉碼時候的參數,具體參數可以用pdf2swf -s help獲取
-w , –samewindow              When converting pdf hyperlinks, don’t make the links open a new window.        設置轉換后的swf打開原pdf中的連接時使用相同的窗口
-t , –stop                    Insert a stop() command in each page.            在每頁結尾添加一個stop()命令
-T , –flashversion num        Set Flash Version in the SWF header to num.         設置SWF所使用的flash版本號
-F , –fontdir directory       Add directory to the font search path.                    指定字體文件所在路徑
-b , –defaultviewer           Link a standard viewer to the swf file.             指定默認的swf導航文件,用來翻頁、放大縮小等等
-l , –defaultloader           Link a standard preloader to the swf file which will be displayed while the main swf is loading.     指定默認的swf加載文件,用來顯示加載進程效果
-B , –viewer filename         Link viewer filename to the swf file.   指定swf導航文件,作用同-b
-L , –preloader filename      Link preloader filename to the swf file.      指定swf加載文件,作用同-l
-q , –quiet                   Suppress normal messages.  Use -qq to suppress warnings, also.  不打印普通信息,用-qq就不打印警告信息。
-S , –shapes                  Don’t use SWF Fonts, but store everything as shape. 不使用字體,所有都轉為形狀。
-f , –fonts                   Store full fonts in SWF. (Don’t reduce to used characters). 在swf中保存全部字體。
-G , –flatten                 Remove as many clip layers from file as possible. 在文件中盡量去除影片層,合並它們
-I , –info                    Don’t do actual conversion, just display a list of all pages in the PDF. 不做實際轉換,僅顯示PDF的信息。
-Q , –maxtime n               Abort conversion after n seconds. Only available on Unix. 如果運行時間超時則退出。

 

2、pdf2htmlEx 命令詳解

  

pdf2htmlEX的一些參數 可以設置生成文件的地址,生成那些文件什么的。

  1. 用法: pdf2htmlEX [options] <input.pdf> [<output.html>]  

  2.   -f,--first-page <int>         需要轉換的起始頁 (默認: 1)  

  3.   -l,--last-page <int>          需要轉換的最后一頁 (默認: 2147483647)  

  4.   --zoom <fp>                   縮放比例  

  5.   --fit-width <fp>              適合寬度 <fp> 像素  

  6.   --fit-height <fp>             適合高度 <fp> 像素  

  7.   --use-cropbox <int>           使用剪切框 (default: 1)  

  8.   --hdpi <fp>                   圖像水平分辨率 (default: 144)  

  9.   --vdpi <fp>                   圖像垂直分辨率 (default: 144)  

  10.   --embed <string>              指定哪些元素應該被嵌入到輸出  

  11.   --embed-css <int>             將CSS文件嵌入到輸出中 (default: 1)  

  12.   --embed-font <int>            將字體文件嵌入到輸出中 (default: 1)  

  13.   --embed-image <int>           將圖片文件嵌入到輸出中 (default: 1)  

  14.   --embed-javascript <int>      將javascript文件嵌入到輸出中 (default: 1)  

  15.   --embed-outline <int>         將鏈接嵌入到輸出中 (default: 1)  

  16.   --split-pages <int>           將頁面分割為單獨的文件 (default: 0)  

  17.   --dest-dir <string>           指定目標目錄 (default: ".")  

  18.   --css-filename <string>       生成的css文件的文件名 (default: "")  

  19.   --page-filename <string>      分割的網頁名稱  (default:"")  

  20.   --outline-filename <string>   生成的鏈接文件名稱 (default:"")  

  21.   --process-nontext <int>       渲染圖行,文字除外 (default: 1)  

  22.   --process-outline <int>       在html中顯示鏈接 (default: 1)  

  23.   --printing <int>              支持打印 (default: 1)  

  24.   --fallback <int>              在備用模式下輸出 (default: 0)  

  25.   --embed-external-font <int>   嵌入局部匹配的外部字體 (default: 1)  

  26.   --font-format <string>        嵌入的字體文件后綴 (ttf,otf,woff,svg) (default: "woff")  

  27.   --decompose-ligature <int>    分解連字-> fi (default:0)  

  28.   --auto-hint <int>             使用fontforge的autohint上的字體時不提示 (default: 0)  

  29.   --external-hint-tool <string> 字體外部提示工具 (overrides --auto-hint) (default: "")  

  30.   --stretch-narrow-glyph <int>  伸展狹窄的字形,而不是填充 (default: 0)  

  31.   --squeeze-wide-glyph <int>    收縮較寬的字形,而不是截斷 (default: 1)  

  32.   --override-fstype <int>       clear the fstype bits in TTF/OTF fonts (default:0)  

  33.   --process-type3 <int>         convert Type 3 fonts for web (experimental) (default: 0)  

  34.   --heps <fp>                   合並文本的水平臨界值,單位:像素(default: 1)  

  35.   --veps <fp>                   vertical threshold for merging text, in pixels (default: 1)  

  36.   --space-threshold <fp>        斷字臨界值 (臨界值 * em) (default:0.125)  

  37.   --font-size-multiplier <fp>   一個大於1的值增加渲染精度 (default: 4)  

  38.   --space-as-offset <int>       把空格字符作為偏移量 (default: 0)  

  39.   --tounicode <int>             如何處理ToUnicode的CMap (0=auto, 1=force,-1=ignore) (default: 0)  

  40.   --optimize-text <int>         盡量減少用於文本的HTML元素的數目 (default: 0)  

  41.   --bg-format <string>          指定背景圖像格式 (default: "png")  

  42.   -o,--owner-password <string>  所有者密碼 (為了加密文件)  

  43.   -u,--user-password <string>   用戶密碼 (為了加密文件)  

  44.   --no-drm <int>                覆蓋文檔的 DRM 設置 (default: 0)  

  45.   --clean-tmp <int>             轉換后刪除臨時文件 (default: 1)  

  46.   --data-dir <string>           指定的數據目錄 (default: ".\share\pdf2htmlEX")  

  47.   --debug <int>                 打印調試信息 (default: 0)  

  48.   -v,--version                  打印版權和版本信息  

  49.   -h,--help                     打印使用幫助信息


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM