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
- XHTML code is not proper
- 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.