项目地址:https://github.com/Stirling-Tools/Stirling-PDF
一.文件目录信息
customFiles是自定义样式,把static文件夹放在customFiles中
/data/mixos/assembly/stirling-pdf/customFiles/static/css
删除不需要的图标和样式:每个css类中增加下方代码
#footer{
display: none;
}
#languageDropdown{
display:none;
width:0px;
height:0px;
}
二.配置文件信息
cd /data/mixos/assembly/stirling-pdf/configs
vim settings.yml
settings.yml:
# Welcome to settings file
# Remove comment marker # if on start of line to enable the configuration
# If you want to override with environment parameter follow parameter naming SECURITY_INITIALLOGIN_USERNAME
security:
enableLogin: false # set to 'true' to enable login
csrfDisabled: true
loginAttemptCount: 5 # lock user account after 5 tries
loginResetTimeMinutes : 120 # lock account for 2 hours after x attempts
system:
defaultLocale: 'zh-CN' # 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)
customApplications:
installBookFormats: false # Installs Calibre for book format conversion (For non docker it must be manually downloaded but will need to be true to show in UI)
installAdvancedHtmlToPDF: false # DO NOT USE EXTERNALLY, NOT SAFE! Install wkHtmlToPDF (For non docker it must be manually downloaded but will need to be true to show in UI)
#ui:
# appName: exampleAppName # Application's visible name
# homeDescription: I am a description # Short description or tagline shown on homepage.
# appNameNavbar: navbarName # Name displayed on the navigation bar
ui:
appName: 创变
homeDescription: PDF一站式服务,满足您的所有PDF需求。 # Short description or tagline shown on homepage.
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
customStaticFilePath: '/customFiles/static/' # Directory path for custom static files
AutomaticallyGenerated:
key: 6d321144-c0e6-4888-801d-b9e013086eae
三.部署命令
docker pull frooodle/s-pdf:latest
docker run -d -p 8908:8080 -v /data/mixos/assembly/stirling-pdf/data/:/usr/share/tesseract-ocr/4.00/tessdata -v /data/mixos/assembly/stirling-pdf/configs/:/configs -v /data/mixos/assembly/stirling-pdf/customFiles:/customFiles -e DOCKER_ENABLE_SECURITY=false -e SYSTEM_ROOTURIPATH=/stirlingpdf --name stirlingpdf frooodle/s-pdf
访问地址:http://10.30.0.29:8908
location /stirlingpdf {
proxy_pass http://10.30.0.29:8908/stirlingpdf;
}
四.其他配置
1. 修改app名称和描述:
vim /data/mixos/assembly/stirling-pdf/configs/settings.yml
ui:
appName: 创变
homeDescription: PDF一站式服务,满足您的所有PDF需求。 # Short description or tagline shown on homepage.
2. 自定义图标:将static中的选中图片按尺寸切好后覆盖即可
3. 图标设置圆角:/static/css/navbar.css添加代码
.main-icon {
border-radius: 40%;
}
4. 浏览pdf功能去掉顶部的小图标以及字样:/static/pdfjs/css/viewer.css 添加代码
.main-icon {
display: none;
}
[class~="icon-text"] {
display: none;
}
5. 删除“浏览pdf”功能:/static/css/home.css 添加代码
#view-pdf{
display: none;
}