相关疑难解决方法(0)

iOS SDK - 以编程方式生成PDF文件

在我的诚实意见中,使用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)

iphone pdf-generation objective-c ipad ios

79
推荐指数
3
解决办法
8万
查看次数

标签 统计

ios ×1

ipad ×1

iphone ×1

objective-c ×1

pdf-generation ×1