I'm following this guide to create PDF but I don't understand what I have to code on myDrawnContent function : https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-CJBFFHHA
Using this guide I'm able to create a PDF with the function:
-(void) MyCreatePDFFile:(CGRect)pageRect filename:(const char *)filename;
I need to code the -(void)myDrawContent:(CGContextRef) pdfContext; I want to set a Tittle on the top, a NSImage and a NSString after the image, how i do that?
Adiccionaly: for that I found this code:
NSString * path = @"/Users/admin/Downloads/prueba.pdf";
PDFDocument * pdf = [[PDFDocument alloc]init];
NSImage *image = [self getRepImage];
PDFPage * page = [[PDFPage alloc ] initWithImage:image];
[pdf insertPage:page atIndex: [pdf pageCount]];
[pdf writeToFile:path];
It creates a pdf with a NSImage but I how do i add text ? Thank you