Closed ChaosSaber closed 8 years ago
I Just found this blog about the slicing of an UIScrollView: http://blog.mosheberman.com/generating-a-pdf-from-a-uiscrollview/ Maybe it helps you to implement this.
@Chaosprogrammierer Hi. Sorry for the late reply..
Admittedly, this library does not support the feature to divide the desired size.
I will try implementing this feature based on your advice(blog).
please wait for a while :bow:
ok Nevermind that made the cut right through a line of text. so maybe not that ideal method. without adjusting the bounds a bit that it don't cut a line in two.
And what about the first part? that the visible part of the pdf is bound to the frame size. is that intended?
@Chaosprogrammierer
And what about the first part? that the visible part of the pdf is bound to the frame size. is that intended?
also this issue will fix...! please wait.
OK thanks, now i just need to find out the actual height of my stack view.
After using layoutSubviews() on the stack view, scrollview and primary view it created a complete pdf page. So problem 1 was my fault because i was using it wrong. it probably didn't render the non visible views. This can be closed now.
I fixed this problem.
If a view has super view , renderInContext
does not work properly.
So I fixed like this:
let superView: UIVIew? = view.superView // store super view if a view has it
view.removeFromSuperView() // remove temporary
// ... render process
superView?.addSubView(view) // restore
see detail : #44
Also fix access control of PDFPageSize : #43
These revisions are released as v1.4.1 .
and.. I will try implementing #41
Thanks reporting problem 🙇
The 1.4.1 update broke PDF generation for me. I am using this library with the latest version of the Charts library (https://github.com/danielgindi/Charts). Generating a PDF from a LineChartView removes it from the superview but never restores it.
@raudabaugh Sorry for replying late.. I resolved this issue at #46 .
Please update to v1.4.2
! 🙇
extractVisiblePart() what will be the implementation of this method
Hello,
So I'm currently experimenting a bit with your PDFgenerator and found some strange things happening, but maybe i'm just using it wrong. What i experienced is that the content size of the scroll view, is the size of the generated pdf, but the frame size of the view is the visible part of the pdf. so when i have a frame size of 595:842 and a content size of 595:1684 i have a page of two A4 sizes but only half of that is written, even if there would be text on the second half.
Thats what i have done: I have a view in a storyboard. in that view is a UIScrollview and in that scrollview is a stack view with labels and images. i created the pdf like this:
The output is an half empty page. When i change the frame-height to 1684 i get an full page.
On a side note a little request. Make the PDFPageSizes public so we users can use them too, because the standard accessor is only internal. And now at last a question. Is it possible to split these long UIScrollview, so that they occupy exactly one page. Would also be a nice standard feature. Something like that:
Thanks in Advance