如何为iOS构建PoDoFo库 [英] how to build PoDoFo library for iOS

查看:270
本文介绍了如何为iOS构建PoDoFo库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是此问题的副本如何使用PoDoFo库在iOS上注释PDF?尚未回复。
我知道如何在iOS的xcode项目中使用/创建静态库。我正在寻找一个免费的PDF库,它支持pdf文件的内存编辑,我开始知道PoDoFo做得很好,我试图为xcode构建这个库,但我真的不知道怎么玩CMake。任何机构都可以告诉我如何将这个库用于我的iOS应用程序。

This may be a copy of this question How can I use the PoDoFo library for annotating PDFs on iOS? not responded yet. i know how to use/create static libraries into xcode projects for iOS. i was looking for a free PDF library which support in memory editing of pdf documents and i came to know that PoDoFo done it very well, i tried to build this library for xcode but i really don't know how to play with CMake. can any body tell me how can i use this library into my iOS application.

谢谢

推荐答案

这是Podofo'自述'文件的摘录

This is an extract from Podofo 'Read me' file


在Mac OS X上构建CMake

Mac OS X用户可以使用CMake构建PoDoFo,方法是生成传统的UNIX Makefile(Unix MakefileCMake目标)或生成XCode项目( Xcode目标。在任何一种情况下都适用以下情况。

Mac OS X users can build PoDoFo using CMake either by generating conventional UNIX Makefiles (the "Unix Makefiles" CMake target) or generating an XCode project (the "Xcode" target). In either case the following applies.

您将需要freetype和fontconfig。可以省略libjpeg的使用(参见独立于平台的文档),但默认情况下也需要libjpeg。如果您已经拥有这些库(例如,来自fink或DarwinPorts),则可以跳过以下部分并相应地更新CMAKE_INCLUDE_PATH和CMAKE_LIBRARY_PATH参数。

You will need freetype and fontconfig. It's possible to omit the use of libjpeg (see the platform-independent documentation) but by default libjpeg will also be required. If you have these libraries already (say, from fink or DarwinPorts) you can skip the following section and update the CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH arguments appropriately.

依赖关系

我假设您正在将podofo和任何必需的库安装到$ HOME / libs中。调整味道,但保持一致。

I'll assume you're installing podofo and any required libraries into $HOME/libs . Adjust to taste, but keep it consistent.

获取任何所需库的最简单方法是使用MacPorts安装libjpeg,fontconfig和freetype库。安装完MacPorts后,只需运行:

The easiest way to get any required libraries is to use MacPorts to install the libjpeg, fontconfig, and freetype libraries. Once you've installed MacPorts, just run:



 /opt/local/bin/port install fontconfig freetype jpeg tiff lua




MacPorts将自动构建库及其依赖项,将它们安装在/ opt / local。

MacPorts will automatically build the libraries and their dependencies, installing them in /opt/local.

如果要将库与您的应用程序一起分发,您需要做的就是使用install_name_tool来设置适当的相对值它们的链接路径并将它们包含在您的应用程序包中 - 就像您使用任何其他库一样。

If you want to distribute the libraries with your application, all you'll need to do is use install_name_tool to set appropriate relative paths for their linkage and include them in your application bundle - just like you do with any other libraries.

PoDoFo本身

您应该可以使用以下方法在Mac OS X上配置和安装podofo:

You should be able to configure and install podofo on Mac OS X using:



    cmake -G "Unix Makefiles" \
        -DWANT_FONTCONFIG:BOOL=TRUE \
        -DCMAKE_INSTALL_PREFIX=/opt/podofo \
        -DCMAKE_INCLUDE_PATH=/opt/local/include \
        -DCMAKE_LIBRARY_PATH=/opt/local/lib \
        ../podofo
    make
    sudo mkdir /opt/podofo
    sudo chown $USER /opt/podofo
    make install




如果要构建XCode,请将Unix Makefiles更改为Xcode相反,而不是运行 make'和 make install'只需打开项目文件并正常工作

change "Unix Makefiles" to "Xcode" if you want to build an XCode project instead, then instead of running make' andmake install' just open the project file and work as normal

不要在命令中使用'XCode',而是键入'Xcode',(c小写),它应该可以解决问题。

Instead of using 'XCode' in the command, type 'Xcode', (c lowercase) and it should do the trick.

这篇关于如何为iOS构建PoDoFo库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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