Looking for something! type & hit enter
They call it fundu Bytes, fun du Bytes & fund u Bytes.
What's your say?

http://fundubytes.blogspot.com/2007/12/create-print-friendly-pdf-for-your.html

Tuesday, December 04, 2007

Create print friendly PDF for your website in 3 steps

print PDF onlinePortable Document Format (PDF) is the most common and widely used format for exchange of documents, newsletters .etc. This article demonstrates how to create online print friendly (optmized, without the hustle & bustle of sidebars, ads .etc) PDF for your website (Blogger used in e.g.)

Step 1: Stylesheet:- Add the following CSS code in the <HEAD> section. [CSS details]


Step 2: Use the above stylesheet to hide/display sections:- Go to Template -> Edit HTML tab (Do not expand template widgets). Sections you want to hide while printing, add them to class 'noprint'. Sections you want to show only in print mode, put them in class 'print'. And the rest will be shown in both modes.

e.g. To hide sidebar use,
<b:section class='sidebar noprint' id='sidebar' preferred='yes'>

Now, Take another example where you want to show/hide selective widgets in 'main-wrapper'.

<div id='main-wrapper'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Feed2' locked='false' title='Recent Articles' type='Feed'/>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
<b:widget id='HTML3' locked='false' title='' type='HTML'/>
</b:section>
</div>

say, you want to hide 'Feed2' in print mode, display 'Blog1' in both modes and display 'HTML3' only in print mode, change the above code to following:-

<div id='main-wrapper'>
<b:section class='main noprint' id='main1' showaddelement='no'>
<b:widget id='Feed2' locked='false' title='Recent Articles' type='Feed'/>
</b:section>
<b:section class='main' id='main2' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
<b:section class='main print' id='main3' showaddelement='no'>
<b:widget id='HTML3' locked='false' title='' type='HTML'/>
</b:section>
</div>

Note the differences in bold & red color. Save the template.
Expand widget template, and embed any custom code you have included within <div> </div> or <p> </p> and put them in appropriate class i.e. print or noprint. You can put post-footer, comments-block, post-footer-line post-footer-line-1 .etc. in noprint class to save both page & ink (if printed on paper later).
Tip: Do print preview for cross check.

Step 3: Print PDF button:- Sign up at Web2PDF Online and get the javascript code or use the following code

replace XXXX with your author_id and modify values of left, right, top & bottom margin as per your requirement.
Now, for a demo, check the 'print PDF button' at the end of each post on this blog.

Currently, Web2PDF supports only English language and has report feature that shows statistics of downloaded PDFs.

Tip: If your report shows large number of downloads, you can monetize this medium too by printing custom made text ads in light shades in header, footer or sidebar area. Now, US based publishers having a valid SSN may apply for Yahoo Ads for Adobe PDF program.

Suggested Reading:-


So, save trees & print as PDF.


Related Articles



5 Scribble(s):

Vishnu Ratheesh said...

aWEsOMe LuI !!!

Pretty neat addition to ya blog.. and very helpful resourse...

Keep up the good wrk!

Rupesh said...

@vishnu,
thanks buddy... and apart from being environment-friendly i.e. saving trees by printing pdf, this method reduces the file size of the pdf too..so takes less time to download... again saving time and money (cost/bits) ;-)

Ani said...

hi rupesh,
u have designed your template very well,ur blog looks cute,i just wanna know how to add the comment form under each post as u did in ur blog.i was searching for this all over the web but couldn't find the good solution.
waitin for ur reply

with regards
-Ani:scorpiopaw
@rediffmail.com

Rupesh said...

@ani,
thanks for the compliment.
Where did you find the comment form under each post on my blog? I could not see it...
Blogger does not give you any option to put comment box under each post like in WordPress.
Though there are some hacks to do so but either CAPTCHA (SPAM protection) can't be used in that method or it uses IFRAME to display the comment page.

Thought Bubble said...

cool blog I'll give it a vote,
in return check out

Color Printing of Brochures Cards Catalogs Letterhead Posters and More

Post a Comment

Comments posted on funduBytes are moderated. Off-topic and abusive posts will be deleted.
हिन्दी में अपनी प्रतिक्रिया लिखने के लिए प्रयोग करें, Google Indic Transliteration

Subscribe to funduBytes newsletter or Trackback comments

SMS JOIN FUNDUBYTES to 567673434 for mobile updates.

-Thanks Rupesh

Looking for something..?

SMS JOIN FUNDUBYTES to 567673434 to subscribe for free mobile updates

© 2007 funduBytes, licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 India License.
For permissions beyond the scope of this license, contact rkmandal@gmail.com
This PDF is powered by Web2PDF online.