Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipage PDFs to have a larger bottom margin each page. #2

Open
bigtunacan opened this issue Feb 5, 2013 · 6 comments
Open

Multipage PDFs to have a larger bottom margin each page. #2

bigtunacan opened this issue Feb 5, 2013 · 6 comments

Comments

@bigtunacan
Copy link
Contributor

I generated a PDF that was about 5 pages long and each page had a larger and larger area at the bottom of the page where it is just white area.

@iclems
Copy link
Owner

iclems commented Feb 20, 2013

Could you provide the HTML source code so that I can reproduce this please ?

@bigtunacan
Copy link
Contributor Author

Unfortunately we ended up working around this issue in our app by just eliminating some of our multi-page reports in our final released app. If I run up against this again I'll send you a sample.

@lopes710
Copy link

Anyone has a solution for this?

@iclems
Copy link
Owner

iclems commented Jan 21, 2014

@lopes710 did you experience this issue as well? Do you have a test file?

@lopes710
Copy link

Yes. i dont have a test file sorry.

I solved it by applying the same color in the context background with the
page background color I was drawing.

In the printToPDF method:

....

for ( int i = 0 ; i < self.numberOfPages ; i++ )

{

    UIGraphicsBeginPDFPage();



         //added this

        CGContextRef currentContext = UIGraphicsGetCurrentContext();

        CGContextSetFillColorWithColor(currentContext, [UIColor

colorWithHexString:@"494949"].CGColor); // set context
background color

        CGContextFillRect(currentContext, bounds);


    [self drawPageAtIndex: i inRect: bounds];

}

....

On Tue, Jan 21, 2014 at 2:52 PM, Clément Wehrung
[email protected]:

@lopes710 https://github.com/lopes710 did you experience this issue as
well? Do you have a test file?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-32886274
.

@Junwang
Copy link

Junwang commented May 17, 2014

I have same issue, someone also reported same issue: http://stackoverflow.com/questions/14775292/html-to-pdf-pages-bottom-margin-grows-larger-with-every-page?rq=1

anyone has a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants