PDF Generation From UIScrollView + iphone

后端 未结 3 1657
半阙折子戏
半阙折子戏 2021-01-03 11:08

I want to generate a pdf of UIScrollView whose content size is near about 320*2000. If I use current graphic image context to capture the scroll view layer, then it only cap

3条回答
  •  花落未央
    2021-01-03 11:35

    is it possible to see your sample code please, I am trying to do the same exactly thing.

    you could send the source code here, thanks for that you would be very generous dott.marco@mac.com

    anyway for your problem maybe this can help:

    You are capturing the visible content only because your scroll view is sized match the visible content only, which it should be. You need to resize your scrollview to match the content you need to capture before you start the drawing code using something like this:

    Code: self.scrollView.frame = CGRectMake(0, 0, "your content width here", "your content height here"); After you are done drawing make sure to resize your scroll view to back, in this case to the container view:

    Code: self.scrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);

提交回复
热议问题