Forum Moderators: open

Message Too Old, No Replies

Printer Friendly Options

         

captainron19

2:13 pm on Feb 24, 2020 (gmt 0)

10+ Year Member



I run a website for my Brother's Deli. It is a basic site and right now I have all of various menus on there. I would like to give an option for visitors of the site to click a print button on the page to automatically open a dialog box for a printer friendly version of the menu.

I do have all menus saved in Word format so it is no problem creating a pdf file for every menu. That would be great for people to download and or download and print on their own but someone told me that it would be impossible to have a PDF file automatically print with one click on site.

Some have mentioned using a java script (which I have no experience with creating)

Here is one of the example of one of the menus I would like to give the option for a clear printer friendly version... [chiarellos.com ]

lammert

2:38 pm on Feb 24, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you have some knowledge of CSS, you can make these pages printer-friendly without JavaScript or a separate CSS file. You do this by defining all elements which you don't want to be printed as display:none for media type print.

For example, if your top menu has a class .topmenu and your footer a CSS class .footer, the following CSS code will automatically remove them from the page if you print it. You can add additional elements which you don't want to see, or change the layout by adding print specific CSS tags.

<style type="text/css" media="print">
<!--
.topmenu,.footer{display:none}
-->
</style>

captainron19

3:52 pm on Feb 24, 2020 (gmt 0)

10+ Year Member



I see where you are coming from lammert .... CSS is not my strong area. I am capable of editing to conform to my needs but not too good in raw css coding

lammert

8:06 am on Feb 25, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There is not much raw coding involved. The layout of the webpage is unchanged. My experience is that for printer-friendly pages you only have to conditionally hide some parts. There is no reformatting necessary and no HTML or CSS knowledge is necessary beyond the level of recognizing the parts in the page you don't want to see on the paper output.

captainron19

12:32 pm on Feb 25, 2020 (gmt 0)

10+ Year Member



Thanks.... I did some reading up on it and working out well. I know have the pages up and running. Just having problem with one more section still showing up in the print. It is my footer items. I did omit the footer section along with some other items in the CSS file I created but for some reason my footer section still comes up in the print ...... but the good news is PROGRESS