1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pdf file for viewlisting.tpl

Discussion in 'Templates, HTML, CSS, and Design Help' started by jason1971, Apr 18, 2014.

  1. jason1971 Customer

    Hi all,

    I'm not going to say "is it possible..." because it usually is :D, but here is what I want to achieve.

    I have created a second 'userbrowselistings.tpl file and it's php file, all works fine for showing the advertisers listings. But what I would like to do is create a link for each of the adverts in userbrowselistings1.tpl, so that is opens a new popup page in a pdf format with a copy of the actual advert details.

    The reason for this is so the advertiser can use it as a leaflet to put in their car or shop window. The reason I do not want to just use the print advert link, is because I only want the advert details to show up not the entire website.

    Make any sense ?:) unless you can come up with a better idea for me ;) . I guess it is not really a necessity but something I think my advertisers could benefit from, as this allows them to advertise offline as well.

    Jason
  2. Mike-N-Tosh Owner

    Jason,

    I am very confused by this request. You state that the reason that you do not want to just use the print advert link is because you only want the advert details to show up, not the entire website.

    Assuming that you actually meant the entire "web page" and not the entire "website", the "Printer-friendly version" does exactly what your request is. It pops up a separate window with only the listing details (e.g. the contents of the viewlisting(2).tpl) in it, allowing you to print it!

    Now if an end user is viewing a listing and simply uses the standard "Print" command in their web browser (not using the link), THEN it would actually print the whole web page (website as you put it). You could dynamically include a stylesheet for @print. That seems overkill especially for the purposes that you state.

    If I'm missing something about this request, please let me know.
  3. jason1971 Customer

    I obviously did the overkill then sorry Mike :confused:, but is there any way that when the link is opened it can go straight to print preview (so my advertisers can see what it would look like before printing it) instead ?
  4. Mike-N-Tosh Owner

    No need to apologize. Unfortunately, there is no definitive way to give the end user a "print preview" from within a web page that I am aware of. Printing in of itself is controlled by the computer OS (Windows, Mac, iOS, Linux), the printer driver, the application being used and the user's settings for printing to a specific printer which are all out of the control of a web page itself. Even just the javascript "print" command doesn't work across the board for every situation.

    The best advice that I could suggest to you would be is to modify the "printer/printlisting.tpl" template file. You will notice that in the <head> there are some general declared styles already, however you could certainly take it much further to have even more control over how it prints. Doing a search online for CSS for printing would give you plenty of additional information as to what you can and can not control in printing a web document.
  5. jason1971 Customer

    Cheers Mike will look in to it.

Share This Page