ios - 在 iOS : Lines and Rectangles 中创建 PDF

标签 ios pdf

我已经在 iOS 下主要使用 [NSString drawAtPoint] 创建了一些 PDF。

我的问题是:如何绘制直线和矩形?
以及如何绘制灰色框/框架作为背景层以在其中包含文本?

编辑:好的,我发现了一些关于绘制矩形的东西:renderInContext。 尽管如此,这段代码: UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(100, 240, 300, 150)];<br/> [lbl setBackgroundColor:[UIColor redColor]];<br/> [[lbl layer] renderInContext:currentContext];<br/>

正在使用正确的宽度/高度绘制 UILabel,但起点 (0, 0) 错误!
知道为什么吗?

最佳答案

关于ios - 在 iOS : Lines and Rectangles 中创建 PDF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10977021/

相关文章:

ios - 对 NSMutableDictionary 进行排序

ios - 如何在核心情节饼图中心添加图片和标题?

ios - 如何在 iOS8 中保留通知中心的同时清除角标(Badge)编号

pdf - 在 pdf 中按宽度调整内容

c# - 如何确定 Adob​​e PDF 打印机所在的 "Ne"端口?

javascript - UIAutomation 获取 TableView 单元格名称

objective-c - 将逗号分隔的 NSString 转换为 NSArray

php - 在没有 PDFTK 的情况下合并 FDF 和 PDF

r - 如何使用 Rmarkdown 自定义标题?

php - 保护PDF文档不被URL直接访问