自动填充 PDF 文件
我有一个允许用户签署合同的应用程序。合同有 3 个框,需要自动填写价格。然后需要打印 PDF 并通过电子邮件发送。
我已经创建了一个允许捕获签名的视图。它的工作原理是在用户签名后获取视图的 CGImage(显然还有更多内容)。
我似乎无法弄清楚两件事:
如何自动填充价格框
将签名图像嵌入 PDF 中进行打印。
任何帮助将不胜感激,并一如既往地感谢您的宝贵时间。
绘制PDF文件的代码
if(document) {
CGPDFPageRef page = CGPDFDocumentGetPage(document, currentPage);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGContextTranslateCTM(ctx, 0.0, [self bounds].size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, [self bounds], 0, true));
CGContextDrawPDFPage(ctx, page);
CGContextRestoreGState(ctx);
}
I have an app that allows users to sign a contract. The contract has 3 boxes that need to be autofilled with prices. The PDF will then need to be printed and emailed.
I already have created a view that allows for signature capture. It works by taking an CGImage of the view after the user signs (obviously there is more to it than that).
I can't seem to figure out 2 things:
How to autofill the boxes with prices
Embed the signature image with the PDF for printing.
Any help would be much appreciated and as always, thank you for your time.
Code to draw PDF file
if(document) {
CGPDFPageRef page = CGPDFDocumentGetPage(document, currentPage);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGContextTranslateCTM(ctx, 0.0, [self bounds].size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, [self bounds], 0, true));
CGContextDrawPDFPage(ctx, page);
CGContextRestoreGState(ctx);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论