查看: 2124|回复: 0

PDFNet包的安装与使用-附:安装Swig

[复制链接]

665

主题

1234

帖子

6678

积分

xdtech

Rank: 5Rank: 5

积分
6678
发表于 2020-4-27 16:32:30 | 显示全部楼层 |阅读模式
本帖最后由 shaoheshaohe 于 2020-4-27 16:39 编辑

第一部分 准备

Custom Python wrapper & Linux PDF library integration
This guide will help you [url=]run PDFTron samples[/url] and [url=]integrate a free trial of the PDFTron SDK into Python applications[/url] on Linux. Your free trial includes unlimited trial usage and support from solution engineers.
There are two ways to use PDFTron with Python:
  • Use the precompiled library for Python 2.7.
  • Use PDFNet bindings to build your own wrapper.
This guide will help you get started by building your own wrapper. You can find more information about using the precompiled library .

Prerequisites
  • Python3 or Python2 with developer extensions
  • CMake version ≥ 2.8
  • SWIG 2.0.4 - 2.0.12 or SWIG 3.0.12
  • PDFTron SDK for Linux:  下载开发包

第二部分 安装

Initial setup
  • Make a directory to store the wrappers and navigate into that directory.
  • Clone the uncompiled PDFNet wrappers project by executing

    git clone https://github.com/PDFTron/PDFNetWrappers
  • Navigate to PDFNetWrappers/PDFNetC and 将下载的PDFNetC64.tar.gz解压 into that directory. Ensure you obtain the right architecture for your Python interpreter. For example, if your interpreter is 64bit (which this guide will assume), execute

    wget http://www.pdftron.com/downloads/PDFNetC64.tar.gz
  • 在PDFNetC目录, execute

    mv PDFNetC64/Headers/ .


    and


    mv PDFNetC64/Lib/ .


    to move the PDFNet libraries in place.

    Your /PDFNetC folder should be laid out like this like this:
    PDFNetC
    ├── Headers
    ├── Lib
    ├── PDFNetC64
    └── README.txt

  • Make a build directory inside /PDFNetWrappers and navigate to it. This guide will assume the build directory is called Build.
  • 在Build目录,Execute


    cmake -D BUILD_PDFNetPython=ON ..


    If all goes well, you should get a message which reads: 【成功时,你将读到以下信息】
    Build files have been written to ~/PDFNetWrappers/Build

  • Execute make followed by sudo make install.


附:安装SWIG
sudo apt-get updatesudo apt-get install swig

可能会遇到“未安装apt-utils”
解决方法:
sudo apt-get update
sudo apt-get install apt-utils

然后再执行一次安装Swig的命令。



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表