2012-06-09 4 views
1

Je suis en train d'imprimer un document PDF en cours de téléchargement par NSURLConnection comme celui-ciUIPrintInteractionController retourne UIPrintUnknownImageFormatError

UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; 
    NSData *PDFData = urlConnection.receivedData; 
    if (pic && [UIPrintInteractionController canPrintData:PDFData]) { 
     pic.printingItem = PDFData; 
     ... 
     [pic presentAnimated:YES completionHandler:completionHandler]; 
    } 

et je reçois UIPrintUnknownImageFormatError dans le completionHandler malgré le pdf est bon et est ouvert par un pdf-viewer. Quel pourrait être le problème avec?

Répondre

0

cette astuce a aidé:

[receivedData writeToFile:filePath atomically:YES]; 
    NSData *PDFData = [NSData dataWithContentsOfFile:filePath]; 
Questions connexes