Digital Inspiration Technology Blog
Digital Inspiration is an award-winning how-to tech blog around all things related to computer software, web applications, mobile and personal productivity.
How to Add QR Codes to your Printed Webpages
http://www.labnol.org/internet/qr-code-for-print-stylesheet/26064/
Oct 10th 2012, 13:44
When you print any web page, your web browser will automatically add the URL of the site in either the footer or the header area of all the printed pages. This is useful because you will always remember the source website where you printed those pages from. →The problem is that web page URLs can be long and complex and people are likely to make errors typing them into the browser.An alternative would be that you create a short URL (using bit.ly or goo.gl) and append it all your printed pages. The other more convenient option is that you add a QR code to the printed copy that will link the printed page to the source web page with a quick scan.A QR Code in the print copy of a web pageAdd a QR Code to Printed Web Pages using CSSYou will be surprised to know how easy it is to add a QR code to any web page but before I share the implementation detail, let's see a live example.Open any article page (for example, this one) and press Ctrl+P (or Cmd+P on a Mac) to open the Print Preview dialog. Scroll to the last page and you will find a QR code that, upon scanning, would lead you to the source page. (If the QR Code missing, just open the Print Preview dialog again.)If you are to implement something similar in your site, just add the following snippet to your website template.<style type="text/css">
@media print {
body:after{
content:url(http://chart.googleapis.com/chart?
cht=qr&chs=200x200&choe=UTF-8&chld=H&chl=<<URL>>)
}
}
</style>
*Replace URL with the actual URL of your web pageWe are basically adding a QR Code image after the <body> tag and since the CSS media type is set to "print," the QR Code will only appear in the printed version of the page. The QR Code is generated dynamically using the Google Charts API and will vary based on the URL.WordPress – To add QR Code support in WordPress print stylesheets, open the template file of your WordPress (like header.php or even index.php) and copy-paste the following code anywhere inside the <head> tag:<?php if (is_single()) : ?>
<style type="text/css">
@media print {
body:after { content:url (
http://chart.googleapis.com/chart?cht=qr&chs=200x200&choe=UTF-8&chld=H&chl=<?= the_permalink(); ?>)
}
}
</style>
<?php endif; ?>Blogger – The equivalent code for classic Blogger templates would be something like this. If you are using the new XML based Blogger templates, you probably need to use data:blog.canonicalUrl (for the permalink) with the condition set as <b:if cond='data:blog.pageType == "item"'> since we are only displaying QR codes on individual post pages and not the archives.<ItemPage><Blogger>
<style type="text/css">
@media print {
body:after { content:url (
http://chart.googleapis.com/chart?cht=qr&chs=200x200&choe=UTF-8&chld=H&chl=<$BlogItemPermalinkURL$>)
}
}
</style>
</Blogger></ItemPage>Also see: Track your Printed Web Pages with Google Analytics This story, How to Add QR Codes to your Printed Webpages, was originally published at Digital Inspiration on 10/10/2012 under Css, QR Codes, WordPress, Internet.
You are receiving this email because you subscribed to this feed at http://blogtrottr.com
If you no longer wish to receive these emails, you can unsubscribe here:
http://blogtrottr.com/unsubscribe/crB/ZwM84m
Digital Inspiration Technology Blog: How to Add QR Codes to your Printed Webpages
Wednesday, 10 October 2012
Subscribe to:
Post Comments (Atom)
Newest Items :
-
▼
2012
(500)
-
▼
October
(177)
- FileHippo.com: Google Chrome 24.0.1312.1 Dev
- FileHippo.com: Origin 9.0.15.65 Beta
- FileHippo.com: AntiVir Personal 13.0.0.2735
- FileHippo.com: Orbit Downloader 4.1.1.3
- FileHippo.com: Internet Download Manager 6.12 Buil...
- Digital Inspiration Technology Blog: Turn CAPS Loc...
- FileHippo.com: Dexpot 1.6.4
- Digital Inspiration Technology Blog: Remove the Pr...
- FileHippo.com: Norton 360 20.2.0.19
- FileHippo.com: CardRecovery 6.10 Build 1210
- FileHippo.com: PeaZip 4.7.3
- FileHippo.com: Norton AntiVirus 20.2.0.19
- FileHippo.com: Thunderbird 16.0.2
- Digital Inspiration Technology Blog: Battle of the...
- FileHippo.com: Foobar2000 1.1.16
- FileHippo.com: VirtualBox 4.2.4.81684
- FileHippo.com: Evernote 4.5.10.7472
- FileHippo.com: Firefox 16.0.2
- FileHippo.com: SeaMonkey 2.13.2
- FileHippo.com: LibreOffice 3.6.3 RC 2
- FileHippo.com: Debut Video Capture 1.68 Beta
- FileHippo.com: CPU-Z 1.62
- FileHippo.com: PhraseExpress 8.0.156
- FileHippo.com: GPU-Z 0.6.6
- Digital Inspiration Technology Blog: How to Upgrad...
- FileHippo.com: Vuze 4.8.0.0
- FileHippo.com: AVG Free Edition 2013.0.2742 (32-bit)
- FileHippo.com: FastPictureViewer 1.9 Build 271 (32...
- FileHippo.com: Flash Player 11.5.500.104 Beta (IE)
- FileHippo.com: Adobe Air 3.5.0.520 Beta
- FileHippo.com: Flash Player 11.5.500.104 Beta (Non...
- FileHippo.com: Spybot Search & Destroy 2.0 RC3
- FileHippo.com: uTorrent 3.2.2 Beta 28326
- Digital Inspiration Technology Blog: Where Can I D...
- Digital Inspiration Technology Blog: Popular Scree...
- Digital Inspiration Technology Blog: How to Hide a...
- Digital Inspiration Technology Blog: How to Embed ...
- FileHippo.com: CCleaner 3.24.1850
- Digital Inspiration Technology Blog: How to Save S...
- FileHippo.com: Google Chrome 24.0.1305.3 Dev
- FileHippo.com: Skype 6.0.0.120
- FileHippo.com: K-Lite Mega Codec Pack 9.40
- FileHippo.com: K-Lite Codec Pack 9.40 (Full)
- FileHippo.com: DragonDisk 1.05
- FileHippo.com: TeamSpeak Client 3.0.9 (32-bit)
- FileHippo.com: Xfire 1.150 Build 45853
- Digital Inspiration Technology Blog: Resize Multip...
- FileHippo.com: Dropbox 1.4.20
- FileHippo.com: TeamViewer 7.0.15723
- FileHippo.com: PDFCreator 1.5.1
- FileHippo.com: Firefox 17.0 Beta 3
- FileHippo.com: Avast! Free Antivirus 7.0.1473
- FileHippo.com: XnView v1.99.5
- FileHippo.com: AMD Catalyst Drivers 12.10 Vista
- FileHippo.com: Shockwave Player 11.6.8.638
- FileHippo.com: IcoFX 2.3.1
- FileHippo.com: DC++ 0.802
- FileHippo.com: SeaMonkey 2.14 Beta 1
- FileHippo.com: Windows 7 Codecs 3.8.1
- FileHippo.com: MediaInfo 0.7.61
- Digital Inspiration Technology Blog: Hundred Zeros...
- FileHippo.com: FileZilla 3.6.0 Beta 1
- FileHippo.com: mIRC 7.27
- FileHippo.com: Any Video Converter 3.5.6
- FileHippo.com: Format Factory 3.00
- FileHippo.com: Foobar2000 1.1.16 beta 1
- FileHippo.com: Miranda 0.10.5
- FileHippo.com: NetBeans IDE 7.2.1
- FileHippo.com: UltraDefrag 5.1.0 (32-bit)
- FileHippo.com: Emsisoft Anti-Malware 7.0.0.12
- FileHippo.com: VirtualBox 4.2.2.81494
- Digital Inspiration Technology Blog: Quickly Disab...
- FileHippo.com: Google Chrome 24.0.1297.0 Dev
- FileHippo.com: VLC Media Player 2.0.4 (32-bit)
- FileHippo.com: Flash Player 11.5.500.97 Beta (Non-IE)
- FileHippo.com: Flash Player 11.5.500.97 Beta (IE)
- FileHippo.com: Adobe Air 3.5.0.460 Beta
- FileHippo.com: Firefox 17.0 Beta 2
- FileHippo.com: Malwarebytes Anti-Malware 1.65.1
- FileHippo.com: Defraggler 2.11.560
- FileHippo.com: SkyDrive Build 16.4.6013.0910
- FileHippo.com: Java Runtime Environment 1.7.0.9 (3...
- FileHippo.com: WinZip 17.0.10283
- FileHippo.com: SuperAntiSpyware 5.6.1012
- FileHippo.com: uTorrent 3.2.2 Beta 28198
- Digital Inspiration Technology Blog: YouTube to Al...
- Digital Inspiration Technology Blog: Uninstall App...
- Digital Inspiration Technology Blog: View LinkedIn...
- Digital Inspiration Technology Blog: Send Self-Des...
- FileHippo.com: DriveImage XML 2.44
- FileHippo.com: Rainlendar 2.11 Beta 125
- FileHippo.com: Adobe Reader 11.0
- FileHippo.com: LibreOffice 3.6.3 RC 1
- FileHippo.com: AVG Free Edition 2013.0.2740 (32-bit)
- FileHippo.com: Macrium Reflect 5.0.5167
- FileHippo.com: Comodo Dragon Internet Browser 22.1
- FileHippo.com: ALLPlayer 5.3
- FileHippo.com: Fresh View 8.40
- FileHippo.com: Camfrog Video Chat 6.3.223
- FileHippo.com: Comodo Internet Security 5.12.252301
-
▼
October
(177)
0 comments:
Post a Comment