Pdf2htmlex cài mac

基础信息

应用名称:pdf2htmlex
应用说明:PDF到HTML转换器
应用程序网站:https. //coolwanglu. github. io/pdf2htmlEX/

安装应用

按Command+Space并键入Terminal,然后按Enter /返回键。
在终端应用程序中运行:

ruby -e "$[curl -fsSL //raw.githubusercontent.com/Homebrew/install/master/install]" < /dev/null 2> /dev/null

,然后按Enter /返回键。
如果屏幕提示您输入密码,请输入Mac的用户密码以继续。当您输入密码时,它不会显示在屏幕上,但是系统会接受它。因此,只需键入您的密码,然后按ENTER / RETURN键。然后等待命令完成。

brew install pdf2htmlex

做完了!您现在可以使用pdf2htmlex。

群名称:macOS使用教程交流群
群 号:1026698226
交流平台:www. nhanh nhẹn. com

Do tính phức tạp của quá trình biên dịch Mac, có một số bước thủ công mà bạn có thể cần phải thực hiện trước khi nhập tệp PDF của mình.  

Các hướng dẫn được cung cấp bên dưới dành cho Homebrew, trình quản lý gói được thiết kế để cài đặt các công cụ trên Mac OS X. Lưu ý rằng việc cài đặt các gói trên Mac có thể mất nhiều phút để hoàn tất, vì vậy hãy kiên nhẫn.  

Kiểm tra Homebrew

Trước tiên, hãy tìm hiểu xem Homebrew đã được cài đặt trên hệ thống của bạn chưa

  1. Mở cửa sổ Terminal. Nhấn Command+Space và nhập Terminal rồi nhấn phím enter/return
  2. Chạy phần sau trong cửa sổ Terminal.
    which brew 
    
    

Nếu Homebrew được cài đặt, nó sẽ hiển thị cho bạn đường dẫn cài đặt.  

Nếu không, nó sẽ cho bạn biết "không tìm thấy lệnh. " Nếu brew chưa được cài đặt thì bạn cần phải cài đặt nó

Cài đặt Homebrew

Trong trường hợp brew không được cài đặt

  1. Chạy lệnh sau trong cửa sổ Terminal để cài đặt.
    ruby -e "$[curl -fsSL //raw.githubusercontent.com/Homebrew/install/master/install]" < /dev/null 2> /dev/null
      và nhấn phím  enter/return  .
  2. Nhập mật khẩu người dùng Mac của bạn nếu nó yêu cầu bạn nhập mật khẩu.
  3. Đợi lệnh kết thúc
  4. Chạy như sau
brew install bash


Tùy thuộc vào chế độ nhập mà bạn chọn, bạn sẽ cần các gói bổ sung.  

Đọc thêm về   3 chế độ nhập khác nhau . Chế độ nội dung có thể chỉnh sửa, Chế độ chính xác & có thể lựa chọn và Văn bản thuần túy.

Chế độ nội dung có thể chỉnh sửa

Cần có gói có tên pdf2htmlex. Chỉ cần chạy phần sau trong cửa sổ Terminal.    

brew install pdf2htmlex

Nếu bạn gặp lỗi về các công thức xung đột, hãy thử lệnh cài đặt lại thay vì cài đặt.  

brew reinstall pdf2htmlex
Chế độ chính xác & có thể lựa chọn

Để tạo các bản quét hình ảnh cho tệp PDF của bạn, cần có gói có tên mutools. Chỉ cần chạy phần sau trong cửa sổ Terminal.  

pdf2htmlEX chuyển đổi PDF sang HTML trong khi vẫn giữ lại văn bản, định dạng và kiểu dáng nhiều nhất có thể bằng cách sử dụng các tính năng HTML5, JavaScript và CSS hiện đại. Ngay cả những nội dung khó như PDF với phông chữ được nhúng, tài liệu nhiều cột, bài báo khoa học với các số liệu và công thức toán học phức tạp hầu hết sẽ được trình bày chính xác. Chế độ dự phòng tạo ra các trang HTML không yêu cầu bất kỳ JavaScript nào để xem chúng một cách chính xác với chi phí là kích thước tệp lớn hơn

Cài đặt

Bạn sẽ cần cài đặt pdf2htmlEX. Nếu bạn đang sử dụng Mac OS X, tôi khuyên bạn nên cài đặt pdf2htmlEX với Homebrew bằng cách chạy lệnh sau

$ brew install pdf2htmlex

Nếu bạn đang sử dụng Debian, bạn có thể cài đặt gói pdf2htmlex như vậy

________số 8_______

Nếu bạn đã thiết lập docker env, chỉ cần cài đặt nó qua docker

$ alias pdf2htmlex="docker run -ti --rm -v ~/pdf:/tmp/pdf iapain/pdf2htmlex pdf2htmlEX"

Sau đó, chỉ cần thêm dòng này vào Gemfile của ứng dụng của bạn

gem 'pdf2htmlex'

Và sau đó thực hiện

$ bundle install

Hoặc cài đặt nó cho mình như

$ gem install pdf2htmlex

Cách sử dụng

Cấu hình

Để chuyển đổi tệp, hãy sử dụng phương thức

$ apt install pdf2htmlex
0 với tệp PDF làm đối số đầu tiên, tên tệp đầu ra tùy chọn làm đối số thứ hai và danh sách các tùy chọn. Thí dụ

2.7.0 [main]:0 > output = Pdf2htmlex.convert['./example/demo1.pdf']
=> #
2.7.0 [main]:0 > output = Pdf2htmlex.convert['./example/demo1.pdf', 'sample.html']
=> #
2.7.0 [main]:0 > output = Pdf2htmlex.convert['./example/demo1.pdf', 'demo.html', dest_dir: '/tmp']
=> #

Tất cả các tùy chọn

first_page: '--first-page',                           # first page to convert [default: 1]
last_page: '--last-page',                             # last page to convert [default: 2147483647]
zoom: '--zoom',                                       # zoom ratio
fit_width: '--fit-width',                             # fit width to  pixels
fit_height: '--fit-height',                           # fit height to  pixels
use_cropbox: '--use-cropbox',                         # use CropBox instead of MediaBox [default: 1]
hdpi: '--hdpi',                                       # horizontal resolution for graphics in DPI [default: 144]
vdpi: '--vdpi',                                       # vertical resolution for graphics in DPI [default: 144]
embed: '--embed',                                     # specify which elements should be embedded into output
embed_css: '--embed-css',                             # embed CSS files into output [default: 1]
embed_font: '--embed-font',                           # embed font files into output [default: 1]
embed_image: '--embed-image',                         # embed image files into output [default: 1]
embed_javascript: '--embed-javascript',               # embed JavaScript files into output [default: 1]
embed_outline: '--embed-outline',                     # embed outlines into output [default: 1]
split_pages: '--split-pages',                         # split pages into separate files [default: 0]
dest_dir: '--dest-dir',                               # specify destination directory [default: "."]
css_filename: '--css-filename',                       # filename of the generated css file [default: ""]
page_filename: '--page-filename',                     # filename template for split pages  [default: ""]
outline_filename: '--outline-filename',               # filename of the generated outline file [default: ""]
process_nontext: '--process-nontext',                 # render graphics in addition to text [default: 1]
process_outline: '--process-outline',                 # show outline in HTML [default: 1]
process_annotation: '--process-annotation',           # show annotation in HTML [default: 0]
process_form: '--process-form',                       # include text fields and radio buttons [default: 0]
printing: '--printing',                               # enable printing support [default: 1]
fallback: '--fallback',                               # output in fallback mode [default: 0]
tmp_file_size_limit: '--tmp-file-size-limit',         # Maximum size [in KB] used by temporary files, -1 for no limit. [default: -1]
embed_external_font: '--embed-external-font',         # embed local match for external fonts [default: 1]
font_format: '--font-format',                         # suffix for embedded font files [ttf,otf,woff,svg] [default: "woff"]
decompose_ligature: '--decompose-ligature',           # decompose ligatures, such as fi -> fi [default: 0]
auto_hint: '--auto-hint',                             # use fontforge autohint on fonts without hints [default: 0]
external_hint_tool: '--external-hint-tool',           # external tool for hinting fonts [overrides --auto-hint] [default: ""]
stretch_narrow_glyph: '--stretch-narrow-glyph',       # stretch narrow glyphs instead of padding them [default: 0]
squeeze_wide_glyph: '--squeeze-wide-glyph',           # shrink wide glyphs instead of truncating them [default: 1]
override_fstype: '--override-fstype',                 # clear the fstype bits in TTF/OTF fonts [default: 0]
process_type3: '--process-type3',                     # convert Type 3 fonts for web [experimental] [default: 0]
heps: '--heps',                                       # horizontal threshold for merging text, in pixels [default: 1]
veps: '--veps',                                       # vertical threshold for merging text, in pixels [default: 1]
space_threshold: '--space-threshold',                 # word break threshold [threshold * em] [default: 0.125]
font_size_multiplier: '--font-size-multiplier',       # a value greater than 1 increases the rendering accuracy [default: 4]
space_as_offset: '--space-as-offset',                 # treat space characters as offsets [default: 0]
tounicode: '--tounicode',                             # how to handle ToUnicode CMaps [0=auto, 1=force, -1=ignore] [default: 0]
optimize_text: '--optimize-text',                     # try to reduce the number of HTML elements used for text [default: 0]
correct_text_visibility: '--correct-text-visibility', # try to detect texts covered by other graphics and properly arrange them [default: 0]
bg_format: '--bg-format',                             # specify background image format [default: "png"]
svg_node_count_limit: '--svg-node-count-limit',       # if node count in a svg background image exceeds this limit, fall back this page to bitmap background; negative value means no limit. [default: -1]
svg_embed_bitmap: '--svg-embed-bitmap',               # 1: embed bitmaps in svg background; 0: dump bitmaps to external files if possible. [default: 1]
owner_password: '--owner-password',                   # owner password [for encrypted files]
user_password: '--user-password',                     # user password [for encrypted files]
no_drm: '--no-drm',                                   # override document DRM settings [default: 0]
clean_tmp: '--clean-tmp',                             # remove temporary files after conversion [default: 1]
tmp_dir: '--tmp-dir',                                 # specify the location of temporary directory. [default: "/var/folders/rn/1xx0_xsd089fldtvtnq1tk7m0000gn/T/"]
data_dir: '--data-dir',                               # specify data directory [default: "/usr/local/Cellar/pdf2htmlex/0.14.6_24/share/pdf2htmlEX"]
debug: '--debug',                                     # print debugging information [default: 0]
proof: '--proof',                                     # texts are drawn on both text layer and background for proof. [default: 0]

Phát triển

Sau khi kiểm tra repo, hãy chạy

$ apt install pdf2htmlex
1 để cài đặt các phụ thuộc. Bạn cũng có thể chạy
$ apt install pdf2htmlex
2 để có lời nhắc tương tác cho phép bạn thử nghiệm

Để cài đặt viên ngọc này vào máy cục bộ của bạn, hãy chạy

$ apt install pdf2htmlex
3. Để phát hành phiên bản mới, hãy cập nhật số phiên bản trong
$ apt install pdf2htmlex
4, sau đó chạy
$ apt install pdf2htmlex
5, thao tác này sẽ tạo thẻ git cho phiên bản, đẩy các cam kết và thẻ git, đồng thời đẩy tệp
$ apt install pdf2htmlex
6 vào rubygems. tổ chức

Chủ Đề