如何为 iOS 构建 PoDoFo 库

发布于 2024-12-29 15:48:30 字数 325 浏览 0 评论 0原文

这可能是这个问题的副本 如何在 iOS 上使用 PoDoFo 库来注释 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.

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬花如无物 2025-01-05 15:48:30

这是 Podofo“自述”文件的摘录

CMake 在 Mac OS X 上构建

Mac OS X 用户可以使用 CMake 构建 PoDoFo,方法是生成传统的 UNIX Makefile(“Unix Makefiles”CMake 目标)或生成 XCode 项目(“Xcode”目标)。无论哪种情况,以下内容均适用。

您将需要 freetype 和 fontconfig。可以省略 libjpeg 的使用(请参阅与平台无关的文档),但默认情况下还需要 libjpeg。如果您已经拥有这些库(例如,来自 fink 或 DarwinPorts),您可以跳过以下部分并适当更新 CMAKE_INCLUDE_PATH 和 CMAKE_LIBRARY_PATH 参数。

依赖关系

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

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

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

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

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

PoDoFo本身

您应该能够使用以下命令在 Mac OS X 上配置和安装 podofo:

    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' 只需打开项目文件并正常工作

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

This is an extract from Podofo 'Read me' file

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文