Stirling-PDF 是一個強大的、本地託管的、基於 Web 的 PDF 操作工具,使用 Docker。它使您能夠對PDF檔案進行各種操作,包括分割、合併、轉換、重組、新增影像、旋轉、壓縮等。這個本地託管的 Web 應用程式已發展為包含一組全面的功能,可滿足您的所有 PDF 要求。
Stirling-PDF 不會出於記錄保存或追蹤目的發起任何出站呼叫。
所有文件和 PDF 要么僅存在於客戶端,僅在任務執行期間駐留在伺服器記憶體中,要么僅在執行任務時臨時駐留在文件中。屆時,用戶下載的任何檔案將從伺服器中刪除。
有關每個任務和使用的技術的概述,請查看 Endpoint-groups.md。
此處提供了該應用程式的演示。
對於 Windows 用戶,請從我們的發布部分或按此處下載最新的 Stirling-PDF.exe。
請查看本地運行指南。
筆記
https://hub.docker.com/r/stirlingtools/stirling-pdf
Stirling-PDF 有三個不同的版本:完整版本、超精簡版本和「胖」版本。根據您使用的功能類型,您可能需要較小的圖像以節省空間。若要了解不同版本提供的功能,請查看我們的版本對應。對於不介意空間優化的人,只需使用最新的標籤即可。
請注意,在下面的範例中,您可能需要根據需要更改磁碟區路徑,例如, ./extraConfigs:/configs
變更為/opt/stirlingpdf/extraConfigs:/configs
。
docker run -d
-p 8080:8080
-v ./trainingData:/usr/share/tessdata
-v ./extraConfigs:/configs
-v ./logs:/logs
# Optional customization (not required)
# -v /location/of/customFiles:/customFiles
-e DOCKER_ENABLE_SECURITY=false
-e INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
-e LANGS=en_GB
--name stirling-pdf
stirlingtools/stirling-pdf:latest
version : ' 3.3 '
services :
stirling-pdf :
image : stirlingtools/stirling-pdf:latest
ports :
- ' 8080:8080 '
volumes :
- ./trainingData:/usr/share/tessdata # Required for extra OCR languages
- ./extraConfigs:/configs
# - ./customFiles:/customFiles/
# - ./logs:/logs/
environment :
- DOCKER_ENABLE_SECURITY=false
- INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
- LANGS=en_GB
注意:Podman 與 Docker 的 CLI 相容,因此只需將“docker”替換為“podman”即可。
請參閱此處的 kubernetes helm 圖表
請查看 HowToUseOCR.md。
某些功能(例如Sign
支援儲存在/customFiles/signatures/
中的預先儲存檔案。放置在此處的圖像檔案可透過 Web UI 存取並使用。目前,它支援兩種資料夾類型:
/customFiles/signatures/ALL_USERS
:所有使用者均可訪問,對於許多使用者使用相同文件的組織或不使用身份驗證的使用者有用/customFiles/signatures/{username}
:例如/customFiles/signatures/froodle
,只有froodle
用戶名可以訪問,其他人私有Stirling-PDF目前支援36種語言!
語言 | 進步 |
---|---|
阿拉伯語(阿拉伯語)(ar_AR) | |
巴斯克語(巴斯克語)(eu_ES) | |
保加利亞語 (Български) (bg_BG) | |
加泰隆尼亞語 (Català) (ca_CA) | |
克羅埃西亞語(赫爾瓦茨基語)(hr_HR) | |
捷克語 (Česky) (cs_CZ) | |
丹麥語 (Dansk) (da_DK) | |
荷蘭語(荷蘭)(nl_NL) | |
英語(英語)(en_GB) | |
英語(美國)(en_US) | |
法文 (Français) (fr_FR) | |
德語 (Deutsch) (de_DE) | |
希臘文 (Ελληνικά) (el_GR) | |
印地語 (हिंदी) (hi_IN) | |
匈牙利語(馬札爾語)(hu_HU) | |
印尼語(印尼語)(id_ID) | |
愛爾蘭語(Gaeilge)(ga_IE) | |
義大利文 (Italiano) (it_IT) | |
日文 (日本文) (ja_JP) | |
韓文 (한국어) (ko_KR) | |
挪威語 (Norsk) (no_NB) | |
波蘭語 (Polski) (pl_PL) | |
葡萄牙語 (Português) (pt_PT) | |
巴西葡萄牙語 (Português) (pt_BR) | |
羅馬尼亞語 (Română) (ro_RO) | |
俄文 (Русский) (ru_RU) | |
塞爾維亞拉丁字母 (Srpski) (sr_LATN_RS) | |
簡體中文 (zh_CN) | |
斯洛伐克語 (Slovensky) (sk_SK) | |
西班牙文 (Español) (es_ES) | |
瑞典語 (Svenska) (sv_SE) | |
泰語 (ไทย) (th_TH) | |
繁體中文 (zh_TW) | |
土耳其語 (Türkçe) (tr_TR) | |
烏克蘭語 (Українська) (uk_UA) | |
越南語 (Tiếng Việt) (vi_VN) |
請參閱我們的貢獻指南。
Stirling PDF 提供了其軟體的企業版,這是同樣出色的軟體,但具有更多功能和舒適性
查看它或我們的官方網站上的文檔
Stirling-PDF 允許輕鬆自訂應用程序,包括:
為此,有兩個選項,要么使用生成的設定檔settings.yml
,該文件位於/configs
目錄中並遵循標準 YAML 格式,要么使用環境變量,這將覆蓋設定檔。
例如,在settings.yml
中,您可能有:
security :
enableLogin : ' true '
若要透過環境變數實現此目的,您可以使用SECURITY_ENABLELOGIN
。
目前的設定清單是:
security :
enableLogin : false # set to 'true' to enable login
csrfDisabled : true # set to 'true' to disable CSRF protection (not recommended for production)
loginAttemptCount : 5 # lock user account after 5 tries; when using e.g. Fail2Ban you can deactivate the function with -1
loginResetTimeMinutes : 120 # lock account for 2 hours after x attempts
loginMethod : all # 'all' (Login Username/Password and OAuth2[must be enabled and configured]), 'normal'(only Login with Username/Password) or 'oauth2'(only Login with OAuth2)
initialLogin :
username : ' ' # initial username for the first login
password : ' ' # initial password for the first login
oauth2 :
enabled : false # set to 'true' to enable login (Note: enableLogin must also be 'true' for this to work)
client :
keycloak :
issuer : ' ' # URL of the Keycloak realm's OpenID Connect Discovery endpoint
clientId : ' ' # client ID for Keycloak OAuth2
clientSecret : ' ' # client secret for Keycloak OAuth2
scopes : openid, profile, email # scopes for Keycloak OAuth2
useAsUsername : preferred_username # field to use as the username for Keycloak OAuth2
google :
clientId : ' ' # client ID for Google OAuth2
clientSecret : ' ' # client secret for Google OAuth2
scopes : https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile # scopes for Google OAuth2
useAsUsername : email # field to use as the username for Google OAuth2
github :
clientId : ' ' # client ID for GitHub OAuth2
clientSecret : ' ' # client secret for GitHub OAuth2
scopes : read:user # scope for GitHub OAuth2
useAsUsername : login # field to use as the username for GitHub OAuth2
issuer : ' ' # set to any provider that supports OpenID Connect Discovery (/.well-known/openid-configuration) endpoint
clientId : ' ' # client ID from your provider
clientSecret : ' ' # client secret from your provider
autoCreateUser : false # set to 'true' to allow auto-creation of non-existing users
blockRegistration : false # set to 'true' to deny login with SSO without prior registration by an admin
useAsUsername : email # default is 'email'; custom fields can be used as the username
scopes : openid, profile, email # specify the scopes for which the application will request permissions
provider : google # set this to your OAuth provider's name, e.g., 'google' or 'keycloak'
saml2 :
enabled : false # currently in alpha, not recommended for use yet, enableAlphaFunctionality must be set to true
autoCreateUser : false # set to 'true' to allow auto-creation of non-existing users
blockRegistration : false # set to 'true' to deny login with SSO without prior registration by an admin
registrationId : stirling
idpMetadataUri : https://dev-XXXXXXXX.okta.com/app/externalKey/sso/saml/metadata
idpSingleLogoutUrl : https://dev-XXXXXXXX.okta.com/app/dev-XXXXXXXX_stirlingpdf_1/externalKey/slo/saml
idpSingleLoginUrl : https://dev-XXXXXXXX.okta.com/app/dev-XXXXXXXX_stirlingpdf_1/externalKey/sso/saml
idpIssuer : http://www.okta.com/externalKey
idpCert : classpath:okta.crt
privateKey : classpath:saml-private-key.key
spCert : classpath:saml-public-cert.crt
enterpriseEdition :
enabled : false # set to 'true' to enable enterprise edition
key : 00000000-0000-0000-0000-000000000000
CustomMetadata :
autoUpdateMetadata : false # set to 'true' to automatically update metadata with below values
author : username # supports text such as 'John Doe' or types such as username to autopopulate with user's username
creator : Stirling-PDF # supports text such as 'Company-PDF'
producer : Stirling-PDF # supports text such as 'Company-PDF'
legal :
termsAndConditions : https://www.stirlingpdf.com/terms-and-conditions # URL to the terms and conditions of your application (e.g. https://example.com/terms). Empty string to disable or filename to load from local file in static folder
privacyPolicy : https://www.stirlingpdf.com/privacy-policy # URL to the privacy policy of your application (e.g. https://example.com/privacy). Empty string to disable or filename to load from local file in static folder
accessibilityStatement : ' ' # URL to the accessibility statement of your application (e.g. https://example.com/accessibility). Empty string to disable or filename to load from local file in static folder
cookiePolicy : ' ' # URL to the cookie policy of your application (e.g. https://example.com/cookie). Empty string to disable or filename to load from local file in static folder
impressum : ' ' # URL to the impressum of your application (e.g. https://example.com/impressum). Empty string to disable or filename to load from local file in static folder
system :
defaultLocale : en-US # set the default language (e.g. 'de-DE', 'fr-FR', etc)
googlevisibility : false # 'true' to allow Google visibility (via robots.txt), 'false' to disallow
enableAlphaFunctionality : false # set to enable functionality which might need more testing before it fully goes live (this feature might make no changes)
showUpdate : false # see when a new update is available
showUpdateOnlyAdmin : false # only admins can see when a new update is available, depending on showUpdate it must be set to 'true'
customHTMLFiles : false # enable to have files placed in /customFiles/templates override the existing template HTML files
tessdataDir : /usr/share/tessdata # path to the directory containing the Tessdata files. This setting is relevant for Windows systems. For Windows users, this path should be adjusted to point to the appropriate directory where the Tessdata files are stored.
enableAnalytics : undefined # set to 'true' to enable analytics, set to 'false' to disable analytics; for enterprise users, this is set to true
ui :
appName : ' ' # application's visible name
homeDescription : ' ' # short description or tagline shown on the homepage
appNameNavbar : ' ' # name displayed on the navigation bar
endpoints :
toRemove : [] # list endpoints to disable (e.g. ['img-to-pdf', 'remove-pages'])
groupsToRemove : [] # list groups to disable (e.g. ['LibreOffice'])
metrics :
enabled : true # 'true' to enable Info APIs (`/api/*`) endpoints, 'false' to disable
# Automatically Generated Settings (Do Not Edit Directly)
AutomaticallyGenerated :
key : example
UUID : example
還有一個額外的設定檔/configs/custom_settings.yml
,熟悉 Java 和 Spring application.properties
的使用者可以在 Stirling-PDF 的現有設定之上輸入自己的設定。
ENDPOINTS_TO_REMOVE
和GROUPS_TO_REMOVE
端點可以包含要停用的以逗號分隔的端點和群組清單。例如, ENDPOINTS_TO_REMOVE=img-to-pdf,remove-pages
將停用影像轉 pdf 和刪除頁面,而GROUPS_TO_REMOVE=LibreOffice
將停用所有使用 LibreOffice 的功能。您可以在此處查看所有端點和群組的清單。/customFiles/static/
目錄中來自訂靜態文件,例如應用程式標誌。自訂應用程式徽標的一個範例是放置/customFiles/static/favicon.svg
來覆蓋目前的 SVG。這可用於更改 Stirling-PDF 中的任何images/icons/css/fonts/js
等。SYSTEM_ROOTURIPATH
- 設定應用程式的根 URI(例如/pdf-app
將根 URI 設定為localhost:8080/pdf-app
)SYSTEM_CONNECTIONTIMEOUTMINUTES
- 設定自訂連線逾時值DOCKER_ENABLE_SECURITY
- 設定為true
下載安全 jar(驗證登入所需)INSTALL_BOOK_AND_ADVANCED_HTML_OPS
- 將 Calibre 下載到 Stirling-PDF 上,以啟用 PDF 與書籍之間的轉換以及高級 HTML 轉換LANGS
- 定義要安裝的自訂字型庫以進行文件轉換對於那些想要使用 Stirling-PDF 的後端 API 連結到自己的自訂腳本來編輯 PDF 的用戶,您可以在此處查看所有現有 API 文檔,或導航至 Stirling-PDF 實例的/swagger-ui/index.html
以取得您的版本的文件(或透過 Stirling-PDF 設定中的 API 按鈕)。
./configs
捲入 Docker 中,以便在更新期間保留它。DOCKER_ENABLE_SECURITY
設為true
來下載安全 jar 版本。settings.yml
檔案啟用登入或將SECURITY_ENABLE_LOGIN
設為true
。admin
和密碼stirling
產生初始使用者。登入時,您將被迫將密碼變更為新密碼。您也可以使用環境變數SECURITY_INITIALLOGIN_USERNAME
和SECURITY_INITIALLOGIN_PASSWORD
立即設定您自己的憑證(建議在建立使用者後將其刪除)。完成上述操作後,重新啟動時,新的stirling-pdf-DB.mv.db
將顯示是否一切正常。
當您登入 Stirling-PDF 時,您將被重定向到/login
頁面以使用這些預設憑證登入。登入後,一切都應該正常。
若要存取您的帳戶設置,請前往設定齒輪選單(導覽列右上角)中的帳戶設定。您也可以在此「帳戶設定」功能表中找到 API 金鑰。
若要新增用戶,請前往帳戶設定底部並點擊「管理設定」。您可以在此處新增用戶。其中提到的不同角色用於速率限制。這是一項正在進行的工作,並將在未來進行更多擴展。
對於 API 使用,您必須提供包含X-API-Key
標頭以及該使用者的關聯 API 金鑰。
這是一個通常由 NGINX 配置引起的問題。 NGINX 的預設檔案上傳大小為 1MB。您需要在 Nginx 網站可用檔案中新增以下內容: client_max_body_size SIZE;
(其中「SIZE」為 50M,例如 50MB 檔案)。
NGINX 預設有逾時值,所以如果你在 NGINX 後面執行 Stirling-PDF,你可能需要設定一個超時值,例如新增配置proxy_read_timeout 3600;
。