I am making a pdf app in which i get problem
// make pdf
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
BOOL isFileCreated;
if(isPortrait)
{
isFileCreated = UIGraphicsBeginPDFContextToFile([NSString stringWithFormat:@"%@/test.pdf",documentsDirectory],CGRectMake(self.m_ScrollView.frame.origin.x, self.m_ScrollView.frame.origin.y-340, self.m_ScrollView.frame.size.width, self.m_ScrollView.contentSize.height), nil);
}
else
{
isFileCreated = UIGraphicsBeginPDFContextToFile([NSString stringWithFormat:@"%@/test.pdf",documentsDirectory],CGRectMake(self.m_ScrollView.frame.origin.x, self.m_ScrollView.frame.origin.y-250, self.m_ScrollView.frame.size.width, self.m_ScrollView.contentSize.height), nil);
}
if(isFileCreated)
{
UIGraphicsBeginPDFPage();
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndPDFContext();
}
this code creates only half pdf. which currently shows on the screen and rest of the pdf is missing which is currently not shown on screen.what should i do? thanks in advance.