在我的诚实意见中,使用CoreGraphics框架是一项繁琐的工作,当涉及到以编程方式绘制PDF文件时.
我想以编程方式创建一个PDF,使用我的应用程序中的视图中的各种对象.
我很想知道iOS SDK是否有任何好的PDF教程,可能是库中的一个下降.
我已经看过这个教程,PDF创建教程,但它主要是用C语言编写的.寻找更多的Objective-C风格.这似乎是一种写入PDF文件的荒谬方式,必须计算线和其他对象的放置位置.
void CreatePDFFile (CGRect pageRect, const char *filename)
{
// This code block sets up our PDF Context so that we can draw to it
CGContextRef pdfContext;
CFStringRef path;
CFURLRef url;
CFMutableDictionaryRef myDictionary = NULL;
// Create a CFString from the filename we provide to this method when we call it
path = CFStringCreateWithCString (NULL, filename,
kCFStringEncodingUTF8);
// Create a CFURL using the CFString we just defined
url = CFURLCreateWithFileSystemPath …Run Code Online (Sandbox Code Playgroud) 我正在尝试编译此处找到的admesh
https://github.com/admesh/admesh
我正在按照安装说明进行操作,主要是配置和制作.但是当我在我的mac中运行make命令时,它给出了以下错误,
MacBook-Pro:admesh mk$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
CC connect.lo
CC normals.lo
CC shared.lo
CC stlinit.lo
CC stl_io.lo
CC util.lo
CCLD libadmesh.la
ld: unknown option: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libadmesh.la] Error 1
make: *** [all] Error 2
MacBook-Pro:admesh mk$ clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我修复此错误.