Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

January 26, 2023, 09:56:29 PM

Login with username, password and session length
Members
  • Total Members: 3856
  • Latest: Bixby
Stats
  • Total Posts: 193807
  • Total Topics: 21124
  • Online today: 63
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 28
Total: 28

Author Topic: HTML Article "Printing" format Question  (Read 801 times)

0 Members and 1 Guest are viewing this topic.

Offline njtweb

  • Jr. Member
  • **
  • Posts: 22
HTML Article "Printing" format Question
« on: October 14, 2022, 12:46:19 PM »
Hello,

I recently started publishing some articles for the start of the high school hockey season. They look great formatted in all browsers, and on handheld wireless devices when scaled to responsive. These articles will be printed by the kids playing to keep for the scrapbooks. I notice when I hit print the formatting gets all jacked up and the images move all over the place. I've tried adding an excessive amount of line breaks to fix the printing problem but the print view doesn't recognize the breaks.

example, today's article.
Code: [Select]
youthhockeyinfo.com/index.php?page=368
Any help is greatly appreciated.

Offline tino

  • Developer
  • *
  • Posts: 2674
Re: HTML Article "Printing" format Question
« Reply #1 on: October 14, 2022, 01:39:46 PM »
I take you mean using the browsers print option.

You would be better of using the following https://ekoopmans.github.io/html2pdf.js as this gives you more control over how it prints.

Offline njtweb

  • Jr. Member
  • **
  • Posts: 22
Re: HTML Article "Printing" format Question
« Reply #2 on: October 14, 2022, 02:09:50 PM »
I take you mean using the browsers print option.

You would be better of using the following https://ekoopmans.github.io/html2pdf.js as this gives you more control over how it prints.

I click the built in TP print function, and then right click and print.

Offline @rjen

  • Support Team
  • *
  • Posts: 3416
    • FJR-club Nederland
Re: HTML Article "Printing" format Question
« Reply #3 on: October 15, 2022, 12:29:50 AM »
I take you mean using the browsers print option.

You would be better of using the following https://ekoopmans.github.io/html2pdf.js as this gives you more control over how it prints.

I click the built in TP print function, and then right click and print.

I do not see a print link on that page
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline jernatety

  • Sr. Member
  • ****
  • Posts: 352
Re: HTML Article "Printing" format Question
« Reply #4 on: October 19, 2022, 09:16:33 AM »
I take you mean using the browsers print option.

You would be better of using the following https://ekoopmans.github.io/html2pdf.js as this gives you more control over how it prints.

I click the built in TP print function, and then right click and print.

I do not see a print link on that page

The print link isn't showing for guests, thank you for pointing that out! Is there a TP permission specifically for the print link?

Offline @rjen

  • Support Team
  • *
  • Posts: 3416
    • FJR-club Nederland
Re: HTML Article "Printing" format Question
« Reply #5 on: October 20, 2022, 12:28:53 AM »
It is not a permission, this is one of the functions that is simply not offered to guests...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline njtweb

  • Jr. Member
  • **
  • Posts: 22
Re: HTML Article "Printing" format Question
« Reply #6 on: October 20, 2022, 06:19:18 AM »
It is not a permission, this is one of the functions that is simply not offered to guests...

Is there any way I can make it offered to guests? This is for high school kids to print their articles so they can put them in their scrap books. I'm fine with making a donation. Please let me know, thank you.

Offline @rjen

  • Support Team
  • *
  • Posts: 3416
    • FJR-club Nederland
Re: HTML Article "Printing" format Question
« Reply #7 on: October 20, 2022, 06:24:19 AM »
Are you willing to hack the code?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline njtweb

  • Jr. Member
  • **
  • Posts: 22
Re: HTML Article "Printing" format Question
« Reply #8 on: October 20, 2022, 06:37:07 AM »
Are you willing to hack the code?

If I'm given instruction and its moderate level and doesn't involve modifying several pages I am, but if it's really involved I guess no, unfortunately.

Offline @rjen

  • Support Team
  • *
  • Posts: 3416
    • FJR-club Nederland
Re: HTML Article "Printing" format Question
« Reply #9 on: October 20, 2022, 08:14:39 AM »
In file TPsubs.template.php

find

Code: [Select]
function article_print($render = true)
{
global $scripturl, $txt, $context;

    $data = '';

if($context['TPortal']['print_articles']==1) {
if(isset($context['TPortal']['article']['boardnews']) && !$context['user']['is_guest']) {
$data .= '
<div class="article_rating"><a href="' . $scripturl . '?action=printpage;topic=' . $context['TPortal']['article']['id'] . '">' . $txt['print_page'] . '</a></div>';
        }
elseif (!$context['user']['is_guest']) {
$data .= '
<div class="article_rating"><a href="' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . ';print">' . $txt['tp-print'] . '</a></div>';
        }
}

and change it to

Code: [Select]
function article_print($render = true)
{
global $scripturl, $txt, $context;

    $data = '';

if($context['TPortal']['print_articles']==1) {
if(isset($context['TPortal']['article']['boardnews'])) {
$data .= '
<div class="article_rating"><a href="' . $scripturl . '?action=printpage;topic=' . $context['TPortal']['article']['id'] . '">' . $txt['print_page'] . '</a></div>';
        }
else {
$data .= '
<div class="article_rating"><a href="' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . ';print">' . $txt['tp-print'] . '</a></div>';
        }
}
« Last Edit: October 20, 2022, 09:27:46 AM by @rjen »
Running Latest TP on SMF2.1 at: www.fjr-club.nl