gpt4 book ai didi

iphone - 如何为 iOS 构建 PoDoFo 库

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:51:29 25 4
gpt4 key购买 nike

这可能是这个问题的副本How can I use the PoDoFo library for annotating PDFs on iOS?还没有回应。我知道如何在 iOS 的 xcode 项目中使用/创建静态库。我一直在寻找一个支持内存编辑 pdf 文档的免费 PDF 库,我开始知道 PoDoFo 做得很好,我试图为 xcode 构建这个库,但我真的不知道如何使用 CMake。谁能告诉我如何在我的 iOS 应用程序中使用这个库。

谢谢

最佳答案

这是 Podofo“Read me”文件的摘录

CMake builds on Mac OS X

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.

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.

Dependencies

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

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 will automatically build the libraries and their dependencies, installing them in /opt/local.

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 itself

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

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 小写),它应该可以解决问题。

关于iphone - 如何为 iOS 构建 PoDoFo 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9047033/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com