I'm sure that makes some other exciting changes as well.
You know, we do have better ways of setting the margin :)
The general suggestion with headers is to bound all of your content
inside of a bounding box, and then draw your headers in the area above
that box.
Search the archive for lots and lots of discussion. None of us like
Prawn's header support, it will improve in the future.
> 2.
> There are 3 pages in my test code, but if i use code:
> pdf.number_pages "/", [doc.pdf.margin_box.right, 0]
> then the third page's content will cover the second page's
> content.
> I also run the code on
> http://github.com/sandal/prawn/blob/stable/examples/general/page_numbering.rb
> but i got the same problem.
You are placing this just outside of the right margin with the
baseline flush with the bottom of the page?
Is that intentional?
Anyway, I don't think this has anything to do with the different pages
contents, unless you did something like
# do something
number_pages(...)
# do something else
and forgot to start a new page there.
But in order to see the problem you are having, I need a complete,
runnable code example, what viewer you are using, and an attachment
with the PDF you generated.
> 3.
> And another problem, I don't know how to fix, I tried many way
> but this problem still there,
> so I think may it's a bug.
> In my pdf(3 pages), have a big table start in the first page and
> end in the second page,
> but there are half page white space in the second page, I
> tried to remove it and let the content
> on third page move to the second page, but failed.
> If I remove the big table, the big white space gone.
It's completely impossible to know what's going on here without an
example we can run.
Looks like you did find a bug. This is related to the change in
bounding box stretchiness calculations.
It can be reproduced trivially with this:
require "prawn/core"
require "prawn/layout"
Prawn::Document.generate("table.pdf") do
table((1..35).map { [ "foo"] }, :position => :center)
text "Hi"
end
If I can put together a quick fix, I'll include it in the 0.6.3
release, which I plan to do first thing tomorrow morning.
-greg