Question

I'm building an app that displays a local pdf with AirPrint. When I print it from the app it doesn't fill the whole page similar to how it prints from safari. The app print is on the bottom, safari is on the top. Here is what it looks like http://i.imgur.com/0USYXf0.jpg

My code to print is straight from the sample code PrintWebView that apple provides. It has to be something in the code that apple provides because it prints the same way from their PrintWebView app.

What do I need to change to fix this?

Edit

I now believe that it is not cutting the pages short but that the pdf pages may be longer than the standard 8.5x11 page size. I think that I need to change the page size that is in the printing code. Still not sure how to get the page to scale similar to how it does in safari on the iPad.

Was it helpful?

Solution

I have figured out what the problem was. It was within PrintPageRenderer.h. All you have to do to fix it is change:

#define SIMPLE_LAYOUT 0

When you change it to 0 it scales the pages correctly for the PDF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top