Bottom table cell that has centered-text get cut off when displayed as PDF in iOS

Originator:zion.perez
Number:rdar://36071788 Date Originated:15 Dec 2017
Status:Open Resolved:No
Product:iOS Product Version:
Classification: Reproducible:Yes
 
Area:
UIKit

Summary:
*************************
I have an iOS app that takes an html file, turns it into a PDF, and displays it to a WebKit web view. I have a weird problem where the bottom table cell gets cut off when I display to PDF. The weird thing is that the bottom table is only cut off when the text is centered. If it is left-aligned, everything works fine. 

Full Detailed Issue:
*************************
https://stackoverflow.com/q/47655057/2179970

Steps to Reproduce:
*************************
1) Download project from github:
https://github.com/starkindustries/PrintPDFTest
2) Run project on iOS device or simulator
3) Once the app is running, tap the 'red' bar button item on the top-right. This makes the table's text centered.
4) Tap the 'landscape' bar button item in the toolbar on the bottom. This prints the html to a PDF in landscape dimensions. Currently you should see a coral-red background, the text is centered, and there is no bottom table cell. 
5) Click the rewind button until the navigation bar title states "PDF Landscape 505." Note that '505' is the height of the table in pixels. You should now see that the table has two cells.
6) Increase the height to 515px by tapping the fast-forward button. Now the bottom table cell is cut off again even though it is within the bounds of the PDF page. This behavior is not desired.

Expected Results:
*************************
The bottom table cell is expected to NOT get cut off when given a height within the PDF bounds.

Actual Results:
*************************
The bottom table cell does get cut off.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!