I have a Visualforce Page( Header with Logo-Image + Content) which is rendered as Pdf. This Vf page will be Emailed via Custom Controller

Scenerio : When Email is Forwarded I want to Have Header(Image) in the Page.(if required-email receiver will take a print on BLANK Paper), But When I am Taking Print out Of the Vf Page (from Salesforce window (Pdf) ) I don't want Image Should be Displayed , b'coz It will be Printed on Letter Head Paper.

Is it Possible Like This.

2 Answers 2


You could use the CSS property of @media to control the visibility of the header. Here's an example of how it's often used. You could do similar with your header or just the image within it by making the pixel size 0x0 or visibility set to off, hidden or color transparent , etc. Be aware that it will always render to the screen showing the header.

@media print {
    body { font-size: 10pt }
  @media screen {
    body { font-size: 13px }

  @media screen, print {
    body { line-height: 1.2 }

The example above is to show how the @media attribute is used with an HTML BODY tag. You'll want to create a CSS class based on the HEADER tag that includes the properties for your images, text and anything else that need adjusted inside your header.

  • So, based on Example.. when I am Printing, font-size will be 10pt, but when I am seeing the page font-size will be at 13px...Is it correct ?
    – user40138
    Nov 17, 2014 at 17:34
  • The example was to show how its done using CSS with a BODY tag. You'll want to create a CSS class based on the HEADER tag for your image, text and other tags that need adjusted that are inside your header.
    – crmprogdev
    Nov 17, 2014 at 19:57

Change the format of Image to .gif and save as interlace....voila!!!

  • Please explain, how your suggestion would solve the stated problem. Your answer is not helpful in its current form. Jan 30, 2015 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .