![]() ![]() Create a bucket where you wish to store your PDFs. Once you do that, head to your console, and under the service tab click S3. I chose Prawn since it was already in the project I jumped into. ![]() ![]() To generate a PDF, any PDF library should work. Put the following gems in your Gemfile and bundle install. Let’s setup our environment and technologies. Steps A) Setup 1) Install gems in Rails 2) Setup s3 account and configuration (bucket) 3) Configure AWS environmental variables (locally and on Heroku) 4) Point to s3 bucket where PDF will be stored/retrieved B) Code 1) Point to s3 bucket where PDF will be stored/retrieved 2) Build new PDF and save it locally 3) Save PDF to s3 4) View PDF at later point 5) Check if PDF exists 6) Build only if PDF doesn't exist A. The technologies used include: Rails, a PDF gem (I use Prawn), the aws-sdk gem, s3, and Heroku. The goal of this blog is to build a PDF, upload it to s3, and be able to download it from s3 at a later point. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |