UIPrintPageRenderer resize footerHeight

82 Views Asked by At

Is it possible to change the footerHeight of some pages in the UIPrintPageRender?

Scenario: In our app we generate PDF files. An additional content came in that will be added in the footer for few pages NOT ALL. So what I did so far is to override the drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int)

override func drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int) {
    footerHeight = displayRemark ? withRemarkFooterHeight : defaultFooterHeight
    super.drawPrintFormatter(printFormatter, forPageAt: pageIndex)
}

I checked the footerHeight with breakpoints and I confirmed it get updated to what I want. But the PDF doesn't resize/recalculate for the said footerHeight.

Anyone able to do this?

Thanks!

0

There are 0 best solutions below