Replies: 2 comments
-
You can use directories in the file name argument. It can be either relative or full path. pdf.render_file "subdirectory/test.pdf" Prawn does not provide anything to save to S3 or anything but local file system. You'll have to consult documentation of the library you use to communicate with S3 to upload the generated file to S3. |
Beta Was this translation helpful? Give feedback.
-
If you're using AWS's official Ruby client, you can use the pdf = Prawn::Document.new
pdf.text "Hello World"
s3_client = Aws::S3::Client.new
s3_client.put_object({
body: pdf.render,
bucket: "examplebucket",
key: "exampleobject"
}) See the AWS SDK docs at https://docs.aws.amazon.com/sdk-for-ruby/v3/api/index.html for more details. |
Beta Was this translation helpful? Give feedback.
-
How should I write to specify the save destination?
pdf.render_file "test.pdf"
This code will be saved in the root directory.
I spend many days on this difficult problem.
It would be really helpful if you could tell me.
Beta Was this translation helpful? Give feedback.
All reactions