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;
。