Domanda

I have installed the PDFKit gem within my app and if i call .pdf on any of my urls it generates a pdf version of the page.

config.middleware.use PDFKit::Middleware,
    :page_size => 'A4',
    :margin_top => '0.39in',
    :margin_right => '0.39in',
    :margin_bottom => '0.39in',
    :margin_left => '0.39in',:print_media_type => true

Is set in my application.rb file but i have a fixed footer that is jumping in between elements when the page is rendered in pdf is there a way to exclude it so that it is ignored by PDF kit?

È stato utile?

Soluzione

Have you tried adding css specifically for the print media type and setting the footer to not display? Something like:

@media print {  
  #footer {  
        display: none;  
    }  
}  
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top