Forum How do I...?

PDF pages missing when printing from Preview

rosebud
Hi,
I was wondering if anyone had experienced this. I am creating a multipage PDF with prince9 on Mac osx mountain lion. My PDF looks great onscreen using Preview. I can look at all the different pages in print settings. However when i send it to the printer, only the 1st two pages print. No error messages anywhere. I can tell it to specifically print page 10, and it will. No matter what I try, it will not print page 3, though I see it onscreen.
I also gave a problem with same PDF with images. I have random lines striking through and svg image and drop shadows and outline "ghosting" added to transparent gifs.

Any ideas for troubleshooting?
Thank you!
mikeday
Can you try this with Acrobat, or another PDF viewer? That will help to check whether it is another bug in MacOS X Preview or not.
rosebud
We tried this morning printing from a windows machine, and it worked great. All pages printed out fine, and no weirdness with the SVGs or the transparent GIFs.
mikeday
Okay, sounds like a bug in MacOS X Preview. Is there something unusual on page 3 that does not appear on pages 1 or 2? An image, or gradient, or font, that is not used elsewhere?
bartdeman
maybe this is related to our problem: http://www.princexml.com/forum/topic/2514/pdf-shows-up-nicely-but-only-1-of-6-custom-fonts-are-printed

are you using embedded fonts on that page and what is the font encoding used?
rosebud
No gradients or different fonts. Page 3 does have a different ID, so I can have a different div flowed to the top header, which contains a unique PNG image [not found on other pages], and a different copyright moved into the bottom page margin.
mikeday
Does it change anything if you comment out the image?
rosebud
I commented out the image, same problem. Then I deleted all of the HTML for page 3 entirely, and it still prints only the first 2 pages, none of the subsequent ones.
rosebud
Ok. I have found the problem. I commented out pages of my pdf to no avail. So I started removing links to my CSS, and kept commenting out chunks until I narrowed it down.

My html is pulling in bootstrap.min.css . And another stylesheet I created with LESS.
On my 3rd page [and some subsequent pages] of my PDF, I have a bunch of stacked progress bars, like the ones seen here:
http://getbootstrap.com/2.3.2/components.html#progress

sample html:
<div class="progress">
<div class="bar bar-success" style="width: 35%;"></div>
<div class="bar bar-warning" style="width: 20%;"></div>
<div class="bar bar-danger" style="width: 10%;"></div>
</div>

the bootstrap.min.css has this style for
.progress{overflow:hidden;
height:20px;
margin-bottom:20px;
background-color:#f5f5f5;
background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);
background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);
-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-border-radius:2px;
-moz-border-radius:2px;
border-radius:2px;}



if I comment out this one line:
background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);

The pdf prints in its entirety, no problems.
Again, this is with Preview. It printed fine without line commented out in Acrobat on a windows machine.

Anyone come across this previously?
Thank you!


Edited by rosebud

mikeday
Good work tracking that one down! It looks like MacOS X Preview doesn't deal with gradients very well. Probably the easiest solution is to override this rule, and set background-image to none. It wouldn't hurt to report the bug to Apple as well.