Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing UG and DG Splits the Images/Text At Page Break #120

Open
sevenseasofbri opened this issue Nov 4, 2020 · 4 comments
Open

Printing UG and DG Splits the Images/Text At Page Break #120

sevenseasofbri opened this issue Nov 4, 2020 · 4 comments

Comments

@sevenseasofbri
Copy link

sevenseasofbri commented Nov 4, 2020

On using the print option in the chrome browser to obtain a PDF of the tp UG or DG (jekyll theme: Minima):

image

The PDF is rendered, however, at page breaks it looks something like this:

image

Sometimes, even the titles are split at page breaks. I have tried the following things:
(some involving CSS which I'm not very proficient in, so I'm probably doing something wrong)

  • Played with the settings in the print mode and seeing whether anything changes. (A trivial thing, most definitely didn't help)
  • One thing I did was try and render the web page after changing some settings in the developer tools:
    image

Selecting the "print" style under rendering:

image
However, this was to no avail :(

  • Another thing is saw a post in stackoverflow recommended changing the CSS style of the theme (?) . So according to this link one may customise the CSS of a jekyll theme in the following manner:

image

So I created style.css in assets and populated it with the following (+ the import statement from the instructions):

@media print {
    div, image, svg {
        break-inside: avoid;
    }

However, still can't seem to print without splitting images and text at page breaks. I think this will be considered as a UG/DG bug if the pdf is like this..

I speculate I'm doing something wrong with CSS OR that I might have to go through the process of installing Bundler and then the Ruby Gems to set up the webpage with jekyll and then be able to add to the existing CSS files. However, still not quite sure.

It would be great to get some help on this issue ^_^"

Thank you in advance!

@okkhoy
Copy link

okkhoy commented Nov 4, 2020

Let me check and reply here.

@okkhoy
Copy link

okkhoy commented Nov 4, 2020

Tip from CS2103:

when we wanted to convert to PDF without lines being split was that we added <div style="page-break-after: always;"></div> at places where we wanted the page to break when printing (to PDF). Of course, this is a manual process, so it's best to only do so once your portfolio page is finalised

@okkhoy
Copy link

okkhoy commented Nov 4, 2020

The guide page has been updated with this workaround: https://se-education.org/guides/tutorials/savingPdf.html

@sevenseasofbri
Copy link
Author

@okkhoy I see. Alright thank you so much Prof!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants