我正在尝试将scrollview内容scrollview到PDF上下文中,并且我正面临着pagination问题。 以下代码我已经使用: – (void)renderTheView:(UIView *)view inPDFContext:(CGContextRef)pdfContext { // Creating frame. CGFloat heightOfPdf = [[[self attributes] objectForKey:SRCPdfHeight] floatValue]; CGFloat widthOfPdf = [[[self attributes] objectForKey:SRCPdfWidth] floatValue]; CGRect pdfFrame = CGRectMake(0, 0, widthOfPdf, heightOfPdf); CGRect viewFrame = [view frame]; if ([view isKindOfClass:[UIScrollView class]]) { viewFrame.size.height = ((UIScrollView *)view).contentSize.height; [view setFrame:viewFrame]; } // Calculates number of pages. NSUInteger totalNumberOfPages […]