Walk through of new features of acts_as_flying_saucer XHTML to PDF

It’s about more than 6 months i haven’t written any post.
Why ?
Recently join new organiztion,
Can’t get time because we are working almost more than 10 to 12 hr day with messy code.
So we are spending more time to refactoring and optimising code,and scaling application also.
Now i started making my time to writing.
In my current organization we are generating various Pdf report.
We are using prawn but now we are switching to  acts_as_flying_saucer.
So there are couple of challenges i have faced
1) XHTML code is not proper
2) Special character in html
Solution
Cleanup Html code
I am using tidy library clean up html code.
By passing :clean=>true it will cleanup html befor generating pdf.
3) Send PDF as email
Solution
Generate PDF on server and do some processing like attached to mail.
:send_attachment => true it will generate pdf and return path of pdf file then do some processing.
So couple of new feature is added to acts_as_flying_saucer
1) Clean up  html by passing :clean=>true
2) Generate pdf on server (locally) by passing :send_attachment=>true
3) acts_as_flying_saucer is also working with rails 3.1 (precomplie asset) and heroku.

It’s about more than 6 months i haven’t written any post Why ?

because recently join new organization, and can’t get much more time , we are working almost more than 10 to 12 hr day with messy code.So we are spending more time to  refactoring and optimizing code,and scaling application.😥

In my current organization we are generating various PDF report.We are using prawn but now we are switching to acts_as_flying_saucer.

So there are couple of challenges i have faced

  1. XHTML code is not proper
  2. Special character in html

Solution: Cleanup Html code

I am using tidy library clean up html code. By passing :clean => true it will cleanup html before generating PDF.

3. Send PDF as email or do some processing

Solution: Generate PDF on server and do some processing like attached to mail.

:send_to_client =>false It will generate pdf and return path of pdf file then do some processing.

4. Generate PDF from String,File,URL

:url – URl/String/File Path Now by passing URL or String or File Path PDF can be generated.

So couple of new feature is added to acts_as_flying_saucer is as follows

1)  Clean up  html by passing :clean=>true

2)  Generate pdf on server (locally) by passing :send_to_client=> false

3)  Fixed issue of non inline CSS issue.

4) Generate PDF from File,String,URL.

5)  More info about acts_as_flying_saucer you can visit wiki

6)  PDF can be generated from Rails,Sinatra,Ruby.

Leave a reply:

Your email address will not be published.

Site Footer