Forum How do I...?

Unexpected page-break and column collapse using bootsrap

itsazzad
Here is the page which I am trying to convert to pdf the file similar to: http://getbootstrap.com/examples/grid/

But its showing unusual output. Its breaking to pages in different unexpected places.
How can I stop breaking into pages?

And another question: What will be the media queries if I use page size as US-Letter? I am using bootstrap. So can you please tell me which media query will affect the page with this command? prince http://getbootstrap.com/examples/grid/ -o output.pdf -v --media=print
Bootstrap3 has these media: Extra small devices Phones (<768px) Small devices Tablets (≥768px) Medium devices Desktops (≥992px) Large devices Desktops (≥1200px)


Thanks in advance.
  1. output.pdf37.4 kB
    Unexpected page breaks; column collapse

Edited by itsazzad

mikeday
Difficult to say, as the style sheets are media dependent. It seems to work better with --media=screen, but it would take some time to track through all the style sheets and figure out exactly what is going on to cause the page breaking.

Prince does not have full support for media queries at this time, so I would suggest just using "@media print { }".
itsazzad
Thank you mikeday.
I have removed all of the available @media queries in the theme following your above reply. So now the output is far better than before. But still now have some of the issues to be resolved:
  • Still now both of the logo and the headline is taking 1 page for each.
  • The rightmost columns are not showing any content
  • The footer is coming under the logo

So can you please help me with some more suggestions?
Here is the a similar input page url: http://getbootstrap.com/examples/grid/
Attached are the input page and the output pdf.
These are the css which I am mainly using to test:
	.container {
		width: 8.5in;
		padding-left: 0px;
		padding-right: 0px;
		margin-left: auto;
		margin-right: auto;
	}

	@page {
		size: US-Letter;
		margin: 0px;
		marks: crop;
		bleed: 0px;
		prince-mark-length: 0px;
		prince-mark-offset: 0px;
		prince-shrink-to-fit: auto;
	}


Thanks again in advance.
  1. output.pdf38.7 kB
    Output
  2. princexml2.html27.5 kB
    Input

Edited by itsazzad

itsazzad
I have changed the html structure and now the page-break issue resolved but still the rightmost column is missing.

Can you please help?
  1. princexml3.html31.1 kB

Edited by itsazzad

itsazzad
Thank you for your help.
Atlast I could solve the issues.

I have changed the html structure little bit. And then these are the ways how I have solved it:
And finally its solved.
  1. princexml3.html31.1 kB

Edited by itsazzad

mikeday
Excellent! The round-up issue is a little tricky, I guess it ended up slightly more than 100% width.