Forum Bugs

Documents being rendered in portrait instead of landscape mode

_prakash
Hi,
We are using prince via princely gem on our rails 4 application. For the last couple of days, the generated pdf is rendering in portrait mode instead of the specified landscape mode; this functionality has been working fine for years.

The CSS we are using:

@page {                                                                            
  size: 8.5in 11in landscape;                                                      
  margin: 5mm 5mm 5mm 5mm;                                                         
}                                                                                  
@page {                                                                            
  @bottom-right {                                                                  
    content: counter(page);                                                        
  }                                                                                
}                                                                                  
#pagebreak {                                                                       
  page-break-after: always;                                                        
} 


Prince version:

 % /usr/bin/prince --version
Prince 8.1 rev 4
Copyright 2002-2012 YesLogic Pty. Ltd.
Non-commercial License


OS version:

 Ubuntu 11.04 


I posted a question on stackoverflow with more details: http://stackoverflow.com/questions/35458780/pdf-file-rendered-in-portrait-instead-of-landscape

Appreciate any help in figuring out this issue. Thanks.
mikeday
First, confirm that the CSS is actually applying, eg. by putting an obvious red background on the @page rule. If that doesn't show up, then that's the culprit.
_prakash
Thanks Mike.

I tried changing the css on the server; the css is definitely not being applied. So looks like the css file is being ignored.

The command line being executed is:

/usr/bin/prince --input=html --server --log=/u/apps/comedyworks/main_app/20160217131503/log/prince.log  -s printpdf.css  --silent - -o -


Why would princexml command line ignore the css?
_prakash
Update:
I found from the prince.log file that it is not able to find the css file. So the issue is something on the rails / princely side, and not related to princexml command line.

Thanks for the help!