Je suis nouveau dans le framework CoreGraphics. Nous avons utilisé la bibliothèque pour rendre ILPDFKit PDF ou sous forme Nous les chemins intégrés tirés à PDF.Here existant est le codeComment autoriser la ré-édition de formulaires (pdf) après leur enregistrement (Objectif C)
- (NSData *) embededPdfAnnotationPointsInPdfAtPath: (NSString *) pdfPath
{
NSURL *pdfUrl = [NSURL fileURLWithPath:pdfPath];
CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfUrl);
NSMutableData *data = [NSMutableData new];
UIGraphicsBeginPDFContextToData(data, CGRectZero, nil);
for(NSUInteger pageIndex = 1; pageIndex <= [self pdfDrawViewInfo].count; pageIndex ++)
{
// Get the current page and page frame
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdf, pageIndex);
const CGRect pageFrame = CGPDFPageGetBoxRect(pdfPage, kCGPDFMediaBox);
UIGraphicsBeginPDFPageWithInfo(pageFrame, nil);
// Draw the page (flipped)
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGContextScaleCTM(ctx, 1, -1);
CGContextTranslateCTM(ctx, 0, -pageFrame.size.height);
CGContextDrawPDFPage(ctx, pdfPage);
CGContextRestoreGState(ctx);
UIImage *drawViewImage = [self annotatedImageForPdfPageAtIndex:(pageIndex - 1)];
UIImage *annotatedImgForPdfPage = [self imageWithImage:drawViewImage scaledToSize:pageFrame.size] ;
[annotatedImgForPdfPage drawInRect:pageFrame];
}
UIGraphicsEndPDFContext();
// CGPDFDocumentRelease (pdf); // CGImageRelease (annotatedImgCGref);
return data;
}
code ci-dessus indique, nous l'image juste coller (chemins dessinés) sur PDF existant.
fonctionnalité plus tard changé en "Après avoir enregistré PDF avec annotations (dessin à main levée), nous devons avoir le contrôle sur des choses annotée"
Question: Modifier PDF avec annotation (dessin à main levée), enregistrez it.After enregistrer le PDF avec des choses annotées, nous devons à nouveau gagner sa capacité d'édition. Nous devons connaître le mécanisme d'économie et les étapes de ce processus. Veuillez mettre vos points de vue ici, afin que cela m'aide beaucoup.
Merci inadvance
Merci pour votre soutien. Stockez les modifications dans un autre fichier. Pourriez-vous élaborer les étapes? –