problem with rendering pdf on the entire screen of pdf

后端 未结 3 1524
借酒劲吻你
借酒劲吻你 2020-12-22 07:18

Hi all I tried in many ways to print a pdf according with the size of the pdf book.i also searched in many links and many codes like apple codes,github and many such type of

3条回答
  •  清酒与你
    2020-12-22 07:51

    Pages in PDF files don't have a standard size. And since you are computing the scale to retain the correct aspect ratio, not all of your PDF files will take up the entire screen.

    Based on your code above, you can make all PDF files fit the entire screen by changing

    CGContextConcatCTM(ctx, CGAffineTransformMakeScale(scaleToApply, scaleToApply));
    

    to

    CGContextConcatCTM(ctx, CGAffineTransformMakeScale(xScale, yScale));
    

    This will screw up the aspect ratio, though.

提交回复
热议问题