-
Notifications
You must be signed in to change notification settings - Fork 5
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
HTML Template with multiple pages only seems to print page 1 #4
Comments
Hi Aaron, the current version (at the time of your writing) did not support "sub-pagination" of "pages". I had simply omitted it as I so far only had hard-formatted pages without any overflow.
While I was at it I also added some more refinements, making 3e1c1ec the most current commit. ( Could you verify that the new feature works as one would expect and—if so—close the issue? |
Wow thats awesome thanks for taking the time to make the code changes I will download it shortly and let you know how I get on :) Thanks again |
Hi, I just had to drop everything to try this out and it works perfectly and can not output my 20 page HTML to PDF all I need to do now is just work out how to manually add in page breaks in the HTML file so that some info does not span over two pages and breaks nicely and I should be all set. I'm going to study the code some more and see if I can figure that out and let you know how I get on Thanks again Aaron |
The overflow feature is awesome, but in my case I have a header and footer that'd like to repeat on every page. The header is static and the footer shows page numbers. Do you think that is easy to add as well? |
@falkobuttler I'd rather DLPDFRenderer be content agnostic than paint itself into a corner by providing support for rather isolated scenarios. It introduces unwanted complexity in both implementation and interface. Thus the only thing I could think of right now would be an optional callback block that gets called for each page after it has been rendered. You could then add your own drawing code in there (for drawing a header, footer, you name it). To make place for the header/footer content you'd simply have to provide sufficient content margins. Also, right now "pages" with more than a single (sub-)page do not increment the page index counter by its (sub-)page-count, but by 1, like every other page. I'll fix that as soon as I find the necessary time. (a header/footer drawing callback would make little sense otherwise) |
@regexident I understand your concerns. I believe it is a major use case to print with header and footer but I also think that the callback solution would be a perfectly feasible solution. The header and footer have static sizes and setting a content margin is perfectly fine. |
You're absolutely right with headers/footers being a major use case. In order to stay content-agnostic one would either have to provide a generic API for passing an optional (HTML) template for header/footer content, which I'd oppose rigorously. A CGContext-based drawing callback block however should be generic enough not only provide an option for drawing a header/footer, but even stuff like watermarks, you name it. |
@falkobuttler, @aaronwardle commit 83eee79 adds support for custom drawing onto a rendered page (and fixes aforementioned indexing bug). (see section Custom Drawing in README for sample code) |
Hi,
Great work on this, I have just downloaded the code and added in a test html file which spans across 10 pages however when I run it through the app only page 1 gets produced multiple times in the PDF.
I'm currently doing this
Any help would be appreciated,
Thanks
The text was updated successfully, but these errors were encountered: