-2

In those months, I'm always reading at code listings on web page (manly brief and coincise tutorials) and these listings have scrollbar to allow horizontal navigation. I would like to print to PDF those web pages but I would gain a cutted code.

I searched for a solution looking at html source code in search of quick configuration to modify, css solutions (overflow-x/y) and javascript scripts (jPrintArea and many homemade) but they are (as far as I have understood) all solution to be implemented by the Owner side and not the User side.

I wanted to know if someone know a script or a method to do that (or at least to print only the code listing block with its original formatting). I suppose it is a problem that the whole community met while learning how to develop with online tutorials.

I can't post images so here two examples: http://codeincomplete.com/posts/2012/6/23/javascript_racer_v1_straight/ https://pgetov.wordpress.com/2013/05/25/first-person-shooter-scene-setup/

1 Answers1

0

You could try to disable javascript temporary. I don't know if this works for you but it could be worth a try.

Source: Mozillazine: Printing a scrollable frame

  • You can always just copy paste the code to print it and reassamble the page manually.
  • I know I can copy-paste to Word but then I (usually) would loose the formatting of the whole webpage, with often terrific results. I would like to use it like last chance solution and look for a more effective method, if available. disabling javascript doesn't affect the scrollbar (the second link doesn't use javascript at all for its code listings). – Enrico Belvisi Sep 14 '15 at 10:59
  • you may want to add that to the question, because "...know a script or method to do that (or at least to print only the code listing)" implies you're searching for any method and not a method that keeps the formatting of the page. –  Sep 14 '15 at 11:04
  • added as suggested. It's the B plan print/copy only the code, the best would be have all webpage suitable for print to PDF. – Enrico Belvisi Sep 14 '15 at 11:13