Stirling-PDF は、Docker を使用した、ローカルでホストされる堅牢な Web ベースの PDF 操作ツールです。 PDF ファイルに対して、分割、結合、変換、再編成、画像の追加、回転、圧縮などのさまざまな操作を実行できます。このローカルでホストされる Web アプリケーションは、包括的な機能セットを包含するように進化し、すべての PDF 要件に対応します。
Stirling-PDF は、記録保持または追跡を目的としてアウトバウンド呼び出しを開始しません。
すべてのファイルと PDF は、クライアント側に排他的に存在するか、タスクの実行中のみサーバー メモリに常駐するか、タスクの実行専用に一時的にファイルに常駐します。ユーザーがダウンロードしたファイルは、その時点までにサーバーから削除されています。
タスクとそれぞれが使用するテクノロジの概要については、Endpoint-groups.md を参照してください。
アプリのデモはここから入手できます。
Windows ユーザーの場合は、リリース セクションから、またはここをクリックして、最新の Stirling-PDF.exe をダウンロードしてください。
LocalRunGuide をご覧ください。
注記
https://hub.docker.com/r/stirlingtools/stirling-pdf
Stirling-PDF には、フル バージョン、ウルトラ ライト バージョン、および「ファット」バージョンの 3 つの異なるバージョンがあります。使用する機能の種類によっては、スペースを節約するために画像を小さくする必要がある場合があります。さまざまなバージョンが何を提供しているかを確認するには、バージョン マッピングをご覧ください。スペースの最適化を気にしない人は、最新のタグを使用してください。
以下の例では、必要に応じてボリューム パスを変更する必要がある場合があることに注意してください (例: ./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 経由でアクセスして使用できるようになります。現在、これは 2 つのフォルダー タイプをサポートしています。
/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) | |
チェコ語 (チェスキー) (cs_CZ) | |
デンマーク語 (ダンスク) (da_DK) | |
オランダ語 (オランダ) (nl_NL) | |
英語 (英語) (en_GB) | |
英語 (米国) (en_US) | |
フランス語 (Français) (fr_FR) | |
ドイツ語 (Deutsch) (de_DE) | |
ギリシャ語 (Ελληνικά) (el_GR) | |
ヒンディー語 (हिंदी) (hi_IN) | |
ハンガリー語 (マジャル語) (hu_HU) | |
インドネシア語 (インドネシア語) (id_ID) | |
アイルランド語 (ガイルゲ) (ga_IE) | |
イタリア語 (Italiano) (it_IT) | |
日本語 (日本語) (ja_JP) | |
韓国語 (한국어) (ko_KR) | |
ノルウェー語 (ノルスク) (no_NB) | |
ポーランド語 (ポルスキ) (pl_PL) | |
ポルトガル語 (Português) (pt_PT) | |
ポルトガル語ブラジル人 (Português) (pt_BR) | |
ルーマニア語 (Română) (ro_RO) | |
ロシア語 (Русский) (ru_RU) | |
セルビア語ラテン文字 (Srpski) (sr_LATN_RS) | |
簡体字中国語 (简体中文) (zh_CN) | |
スロバキア語 (スロベンスキー) (sk_SK) | |
スペイン語 (スペイン語) (es_ES) | |
スウェーデン語 (Svenska) (sv_SE) | |
タイ語 (ไทย) (th_TH) | |
繁体字中国語 (繁體中文) (zh_TW) | |
トルコ語 (Türkçe) (tr_TR) | |
ウクライナ語 (Українська) (uk_UA) | |
ベトナム語 (Tiếng Việt) (vi_VN) |
貢献ガイドをご覧ください。
Stirling PDF はソフトウェアの Enterprise エディションを提供しています。これは同じ優れたソフトウェアですが、追加の機能と快適さが備わっています。
ドキュメントまたは公式 Web サイトを確認してください。
Stirling-PDF を使用すると、次のようなアプリを簡単にカスタマイズできます。
これには 2 つのオプションがあります。 /configs
ディレクトリにあり、標準の YAML 形式に従い、生成された設定ファイルsettings.yml
を使用するか、設定ファイルをオーバーライドする環境変数を使用するかのいずれかです。
たとえば、 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
image-to-pdf とページの削除の両方を無効にし、 GROUPS_TO_REMOVE=LibreOffice
LibreOffice を使用するすべてのものを無効にします。すべてのエンドポイントとグループのリストはここで確認できます。/customFiles/static/
ディレクトリにファイルを配置して、アプリのロゴなどの静的ファイルをカスタマイズします。アプリのロゴをカスタマイズする例としては、 /customFiles/static/favicon.svg
を配置して現在の SVG をオーバーライドすることが挙げられます。これを使用して、Stirling-PDF のimages/icons/css/fonts/js
などを変更できます。SYSTEM_ROOTURIPATH
- アプリケーションのルート URI を設定します (例: ルート URI をlocalhost:8080/pdf-app
に設定する場合は/pdf-app
)SYSTEM_CONNECTIONTIMEOUTMINUTES
- カスタム接続タイムアウト値を設定するDOCKER_ENABLE_SECURITY
- セキュリティ jar をダウンロードするにはtrue
に設定します (認証ログインに必要)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_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;
(たとえば、50MB ファイルの場合、「SIZE」は 50M です)。
NGINX にはデフォルトでタイムアウト値があるため、NGINX の背後で Stirling-PDF を実行している場合は、構成proxy_read_timeout 3600;
。