1

i am using PoDoFo library for standard PDF annotation it working ios6 and earlier when i upgrade app into ios7 it display EXC_BAD_ACCESS like this

enter image description here

it crash in this code

  PdfMemDocument *doc1 = [APDFManager createPdfForFileAtPath:pdfpath_name];

+(PdfMemDocument*)createPdfForFileAtPath:(NSString*)path
{

    PoDoFo::PdfMemDocument* doc = new PoDoFo::PdfMemDocument([path UTF8String]);

    return (PdfMemDocument*)doc;
}
Qamar Suleiman
  • 1,228
  • 2
  • 18
  • 31
kirti Chavda
  • 3,029
  • 2
  • 17
  • 29

1 Answers1

2

I have been personally using podofo in both iOS6 and 7 but didn't find any of these issues. Try this piece of code instead for Creating PdfMemDocument*

    PdfMemDocument *memDoc;
    PdfFileInputStream fileInputStream(filePath);
    char *srcBuffer = new char[fileInputStream.GetFileLength()];
    size_t srcLen = fileInputStream.GetFileLength();
    fileInputStream.Read(srcBuffer,srcLen);


    PdfOutputDevice outputDevice(filePath);

    outputDevice.Write(srcBuffer,srcLen);

    memDoc.Load(srcBuffer,srcLen);

    return memDoc;
Qamar Suleiman
  • 1,228
  • 2
  • 18
  • 31
  • Do you have sample project or, something? But the code above too crash on `memDoc.Load` – iphonic Jun 05 '14 at 10:51
  • The only way you could have a better crash log is if you compile Podofo of your own rather than getting an already compiled version.I am sure something is not linking correctly with iOS 7. The simplest way to compile podofo is to create a new Xcode project and add files to it. You can use the dependencies from the project you already have. Hope this helps – Qamar Suleiman Jun 14 '14 at 16:26