May 12

In previous article we have seen that how pdf is generated  using act_as_flying_saucer plugin.

Following code snippets is used for generating pdf with bookmark .


      <bookmark <strong>name="Section 1" href="#section_1"</strong>>
        <bookmark name="Section 1.1" href="#section_11"></bookmark>
        <bookmark name="Section 1.2" href="#section_12"></bookmark>
      <bookmark name="Section 2" href="#section_2"></bookmark>
      <bookmark name="Section 2" href="#section_3"></bookmark>



    <div style="page-break-before: always;">
      <a <strong>name="section_1"</strong>>Section 1</a>
    <div style="page-break-before: always;">
      <a name="section_11">Section 1.1</a>
    <div style="page-break-before: always;">
      <a name="section_12">Section 1.1.2</a>
    <div style="page-break-before: always;">
       <a name="section_2">Section 2</a>
    <div style="page-break-before: always;">
       <a name="section_3">Section 3</a>



<bookmark name=”section 1″  href=”#section_1″> tag is used to generate bookmark.
which contains name attribute for displaying name of bookmark.
href attribute is used for navigation purpose.

<bookmark> tag can be nested so it can be used for generating nested bookmark
<bookmark> tag is wrapper with <bookmarks> tag. This tag placed in html header.

Now in html body whichever anchor tag has name attribute with value as same as bookmark
href value on that position user is navigated.

Mainly two tag is used which is displayed below.

<bookmark name=”Name Of Bookmark”  href=”#bookmark1“>< /bookmark>
<a name=”bookmark1″>Text</a>

Tagged with:
May 12

Pdf with password protected in rails

In previous article we have seen that how pdf is generated  using act_as_flying_saucer plugin. Now  act_flying_saucer  has added support for  password protected pdf.

To generate PDF with password protection just pass :password=>”xxx” to render_pdf method.

render_pdf :file=>'pdf/generate_pdf.html.erb',:password=>"xxx"</pre>

You can install act_as_flying_saucer plugin

 script/plugin install

For  further details you can visit article or visit

Tagged with:
Feb 05

Today, I have started testing Beta release of Rails 3.0.By Default Rails 3.0 start with webrick.To start with mongrel do following steps.

1)Install mongrel gem

sudo gem install mongrel

2) After installing mongrel gem go to config/boot.rb file

and add following line

  require "mongrel"

3) Start server as rails server

Tagged with:
preload preload preload