1. 程式人生 > >Python3.x:pdf2htmlEX(解析pdf)安裝和使用

Python3.x:pdf2htmlEX(解析pdf)安裝和使用

targe drm oom height pbo gin mage output javascrip

Python3.x:pdf2htmlEX(解析pdf)安裝和使用

簡介

pdf2htmlEX是一款優秀的pdf轉換成html的工具;

下載

windows下載地址:http://soft.rubypdf.com/software/pdf2htmlex-windows-version

安裝

下載pdf2htmlEX-win32-0.14.6-with-poppler-data.zip後,直接解壓,即可用;

測試

在dos窗口中切換到解壓目錄:

cd /d D:\pdf2htmlEX-win32-0.14.6

輸入測試命令:

pdf2htmlex -v

結果如下圖,表示安裝成功;

技術分享圖片

pdf2html命令用法

用法: pdf2htmlEX [options] <input.pdf> [<output.html>]  
  -f,--first-page <int>         需要轉換的起始頁 (默認: 1)  
  -l,--last-page <int>          需要轉換的最後一頁 (默認: 2147483647)  
  --zoom <fp>                   縮放比例  
  --fit-width <fp>              適合寬度 <fp> 像素  
  --fit-height <fp>             適合高度 <fp> 像素  
  
--use-cropbox <int> 使用剪切框 (default: 1) --hdpi <fp> 圖像水平分辨率 (default: 144) --vdpi <fp> 圖像垂直分辨率 (default: 144) --embed <string> 指定哪些元素應該被嵌入到輸出 --embed-css <int> 將CSS文件嵌入到輸出中 (default: 1)
--embed-font <int> 將字體文件嵌入到輸出中 (default: 1) --embed-image <int> 將圖片文件嵌入到輸出中 (default: 1) --embed-javascript <int> 將javascript文件嵌入到輸出中 (default: 1) --embed-outline <int> 將鏈接嵌入到輸出中 (default: 1) --split-pages <int> 將頁面分割為單獨的文件 (default: 0) --dest-dir <string> 指定目標目錄 (default: ".") --css-filename <string> 生成的css文件的文件名 (default: "") --page-filename <string> 分割的網頁名稱 (default:"") --outline-filename <string> 生成的鏈接文件名稱 (default:"") --process-nontext <int> 渲染圖行,文字除外 (default: 1) --process-outline <int> 在html中顯示鏈接 (default: 1) --printing <int> 支持打印 (default: 1) --fallback <int> 在備用模式下輸出 (default: 0) --embed-external-font <int> 嵌入局部匹配的外部字體 (default: 1) --font-format <string> 嵌入的字體文件後綴 (ttf,otf,woff,svg) (default: "woff") --decompose-ligature <int> 分解連字-> fi (default:0) --auto-hint <int> 使用fontforge的autohint上的字體時不提示 (default: 0) --external-hint-tool <string> 字體外部提示工具 (overrides --auto-hint) (default: "") --stretch-narrow-glyph <int> 伸展狹窄的字形,而不是填充 (default: 0) --squeeze-wide-glyph <int> 收縮較寬的字形,而不是截斷 (default: 1) --override-fstype <int> clear the fstype bits in TTF/OTF fonts (default:0) --process-type3 <int> convert Type 3 fonts for web (experimental) (default: 0) --heps <fp> 合並文本的水平臨界值,單位:像素(default: 1) --veps <fp> vertical threshold for merging text, in pixels (default: 1) --space-threshold <fp> 斷字臨界值 (臨界值 * em) (default:0.125) --font-size-multiplier <fp> 一個大於1的值增加渲染精度 (default: 4) --space-as-offset <int> 把空格字符作為偏移量 (default: 0) --tounicode <int> 如何處理ToUnicode的CMap (0=auto, 1=force,-1=ignore) (default: 0) --optimize-text <int> 盡量減少用於文本的HTML元素的數目 (default: 0) --bg-format <string> 指定背景圖像格式 (default: "png") -o,--owner-password <string> 所有者密碼 (為了加密文件) -u,--user-password <string> 用戶密碼 (為了加密文件) --no-drm <int> 覆蓋文檔的 DRM 設置 (default: 0) --clean-tmp <int> 轉換後刪除臨時文件 (default: 1) --data-dir <string> 指定的數據目錄 (default: ".\share\pdf2htmlEX") --debug <int> 打印調試信息 (default: 0) -v,--version 打印版權和版本信息 -h,--help 打印使用幫助信息

python3中調用pdf2htmlex示例

Python3.x:pdf2htmlEX(解析pdf)安裝和使用