Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

App Crash while rendering page 10 years 2 weeks ago #5949

  • Navdeep_rs
  • Navdeep_rs's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 0
I am using this code to open PDF
-(void)OpenPDFFile
{
NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *pdfFullPath = [documentsPath stringByAppendingPathComponent:@"ios7.pdf"];
PDFFileStream *stream = [[PDFFileStream alloc] init];
[stream open:pdfFullPath];
[self PDFOpenStream:stream :nil];
/* This works fine*/
//[self PDFOpen:pdfFullPath :nil];
int pageno =1;
// [m_pdf initbar:pageno];
[self PDFThumbNailinit:pageno];
}
When i use "PDFOpen" method to open PDF it works fine, but when i try to open file stream using "PDFOpenStream" method, app crashes at this method.
-(bool)render:(PDFDIB *)dib:(PDFMatrix *)mat:(int)quality
{
return Page_render(m_page, [dib handle], [mat handle], true, quality);
}


In ur sample, when I use "PDFOpenStream" in "selectRightAction" method it works fine. but when i shift this(selectRightAction) method to RDAppDelegate, to bypass RDFileTableController page and open RDPDFViewController directly, same crash occurs. Although "PDFOpen" method works fine from there.


I have no idea whats happening here, what m i missing? Please help.

Please Log in or Create an account to join the conversation.

Last edit: by mehmetalishaqiri.

App Crash while rendering page 10 years 2 weeks ago #5952

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
maybe some issue in PDFFileStream class.

Please Log in or Create an account to join the conversation.

App Crash while rendering page 10 years 2 weeks ago #5953

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
OK, it seems you shall maintance stream object till Document object closed.
The following user(s) said Thank You: mehmetalishaqiri

Please Log in or Create an account to join the conversation.

App Crash while rendering page 10 years 2 weeks ago #5954

  • Navdeep_rs
  • Navdeep_rs's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 14
  • Thank you received: 0
Thnx @radaee, that did a trick.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum