在共享服务器上使用PDFtk [英] Using PDFtk on a shared server

查看:168
本文介绍了在共享服务器上使用PDFtk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PDFtk ,但我有几个问题,我只是打包在一起。


  1. 如何在我共享的网络服务器上安装它?我使用 WebHostingHub ,他们的服务器运行CentOS。

  2. 如何用它?我不知道如何通过PHP运行一个命令行工具,这是我认为我需要做的。我没有任何运行任何命令行的经验,像这样的自动化过程。 (我使用domPDF将表单结果转换为.pdf,但是我需要从用户将要上传的单独文档附加一个附加页面,这就是为什么我使用PDFtk。)

注意,我的服务器不提供ssh访问。

解决方案


如何在共享的网络服务器上安装它?


您可以在应用程序中添加二进制文件,然后设置环境路径到包含二进制文件的 bin 文件夹。

  $ mkdir -p [my_project] / vendor / pdftk / lib [my_project] vendor / pdftk / bin 
$ cd / tmp
$ git clone https://github.com/millie/pdftk-source.git
$ cd pdftk-source
$ tar xzvf pdftk.tar.gz
$ mv bin / pdftk [my_project] / vendor / pdftk / bin /
$ mv lib / libgcj。 so.12 [my_project] / vendor / pdftk / lib /
$ cd [my_project]

如何使用它?


首先,读取 PDF实验室文档,然后发布,如果您有关于如何做某事的问题


I'm looking into using PDFtk, but I have several questions that I'm just going to bundle together. (Let me know if they should be asked separately.)

  1. How would I install it on my shared web server? I use WebHostingHub, and their servers run CentOS.
  2. How do you use it? I'm not sure how to run a command-line tool through PHP, which is what I assume I would need to do. I don't have any experience with running anything command-line as an automated process like this. (I use domPDF to convert form results to a .pdf, but I'll need to attach an additional page to the end from a separate document that the user will upload. This is why I'm using PDFtk.)

As a note, my server does not provide ssh access. I can contact support, however, if absolutely necessary, and they may be able to install it for me.

解决方案

How would I install it on my shared web server?

You can include the binaries in your app, and then set the environment path to the bin folder which holds the binaries.

$ mkdir -p [my_project]/vendor/pdftk/lib [my_project]vendor/pdftk/bin
$ cd /tmp
$ git clone https://github.com/millie/pdftk-source.git
$ cd pdftk-source
$ tar xzvf pdftk.tar.gz
$ mv bin/pdftk [my_project]/vendor/pdftk/bin/
$ mv lib/libgcj.so.12 [my_project]/vendor/pdftk/lib/
$ cd [my_project]

How do you use it?

First, read the PDF Labs Documentation, and then post if you have a question on how to do something specific

这篇关于在共享服务器上使用PDFtk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆