【发布时间】:2012-09-11 21:29:31
【问题描述】:
我正在使用以下代码从 iOS 中的 HTML 字符串生成 PDF。创建 PDF 时,我似乎丢失了任何标签。我已经尝试在设备上添加指向文件的 src 属性以及将 base64 图像数据放入源中。
这里我创建了一个 UIMarkupTextPrinterFormatter:
UIMarkupTextPrintFormatter *fmt = [[UIMarkupTextPrintFormatter alloc]
initWithMarkupText:htmlStringHere];
我的 htmlStringHere 值包含:
<html><head><style>.testClass{color:yellow;font-weight:bold;}</style></head><body><img src="Icon.png" ></img></body>
然后我使用自定义 UIPrintPageRenderer 来生成 PDF。此时,图像已经丢失。但是其他 html 元素并没有丢失。
【问题讨论】:
标签: objective-c ios pdf