Public Lab Research note


making PDFs from wiki pages

by mathew | March 31, 2015 20:51 31 Mar 20:51 | #11732 | #11732

Sometimes you just need information paper. In my case, I'm formatting wiki pages and research notes for a test of our infrared curriculum.

The default browser print mode produces a mess by displaying all the links:

Screen_Shot_2015-03-31_at_1.39.52_PM.png

To make a more readable print, I use Firefox and a plugin called Print Edit. Print Edit adds a little button to Firefox that puts you into edit mode:

Screen_Shot_2015-03-31_at_1_09_43_PM.png

You want to switch to "web style" and then select the rectangle shown, by clicking in the upper right corner of that area. That rectangle represents the main stream of content.

Screen_Shot_2015-03-31_at_1_12_25_PM.png

Once selected, press "Delete Except" and select "unrestricted" this will delete everything except the content of the note or wiki page.

Screen_Shot_2015-03-31_at_1_12_39_PM.png

That's it! Hit "preview" and then "print" to get a PDF.

Screen_Shot_2015-03-31_at_1.13.40_PM.png

Print Edit works on any web page too!


6 Comments

Hi, Mathew, there is a CSS switch to turn off links in print mode, which we can easily add, but some people may want links in their print versions, right? We could make a button which adds this style before you print, optionally. I put the CSS line in the github issue you'd opened, here: https://github.com/publiclab/plots2/issues/196#issuecomment-88253968

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Maybe it could show with a printer icon. Also if there are other things you'd like to improve about the print stylesheets, we should open an issue for that too. Some page content is hidden in print.css, like the navbar and sidebar. But we've added features since then so maybe we have to hide more thinks to ensure the page is tidy.

Reply to this comment...


the link issue is complicated-- I'd like to know a link is there-- but I don't necessarily want the link intruding into my text. I'll put some info about our current print mode on the github issue

Reply to this comment...


Actually this works pretty well!

$('#content').append('<div id="endnotes"><h3>Endnotes</h3></div>');$.each($('#content a'),function(i,a){ i+= 1;$('#endnotes').append("<p>"+i+": "+$(a).attr('href')+"</p>");$(a).attr('href',i); })

Try it out by copy/pasting it into your javascript console, then hitting "print" on the page.

Reply to this comment...


I couldn't make a button for it here in the comments (probably a good thing haha) but this would be easy to add to the site; would a "printer" link, maybe next to the "shortlink" link, be appropriate?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


I took a look at lesson three about IR light (http://publiclaboratory.org/wiki/public-lab-lesson-3-photography-in-a-new-light) and made some comments in the talk tab. I assume nobody gets notified when this happens, so I thought I would alert you here. I guess there is no way to be alerted to changes in wiki pages, and no other way to comment on them. Sorry my comments are so late, especially since you are already burning pdfs from the wiki. I guess I could have just edited the wiki, but that seems rude and inappropriate. I also don't know who is correct about the issues I raise, but I'm pretty sure it's not the person who told you that some smart phone cameras don't have IR block filters.

Reply to this comment...


Login to comment.