Create PDF form in object c with image

I need to create a PDF form containing images and text, so I search on google, I am very good at text, but I don’t know about the image. some people tell me that the user is “PDF Form Button” to display the image, but when my PDF opens in Webview and clicks the button, I need to see the image library and select the image that is installed in the PDF. Does anyone have an idea?

+4
source share
2 answers

Hello, I am using this library PDF, and I am sure, using this library,

Try this library to hope that it works, that you like it.

https://github.com/derekblair/ILPDFKit

Fast start:

PDFDocument *document = [[PDFDocument alloc] initWithResource:@"test.pdf"];
// Manually set a form value
[document.forms setValue:@"Derek" forFormWithName:@"Contacts.FirstName"];
// Save via a static PDF.
NSData* flatPDF = [document savedStaticPDFData]
+3
source

You can use CoreGraphics to draw pdf files on iOS with UIGraphicsBeginPDFContextToFile, just as you can draw images with UIGraphicsBeginImageContextWithOptions. When using pdf, you can add UIImageto pdf using the method drawInRect:

 UIImage * image = [UIImage imageNamed:@"myImage"];
 [image drawInRect:CGRectMake(50, 50, 100, 200)];

You should check Apple's Creating PDF Content Guide .

0
source

All Articles