Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

images are not getting displayed #159

Open
ritaamritkar1212 opened this issue Oct 2, 2023 · 0 comments
Open

images are not getting displayed #159

ritaamritkar1212 opened this issue Oct 2, 2023 · 0 comments

Comments

@ritaamritkar1212
Copy link

ritaamritkar1212 commented Oct 2, 2023

test.docx
Hi,

I am creating the word doc using caracal and saving that on s3. But generated word document is corrupted as well images are not getting displayed.

docx = Caracal::Document.new("test.docx")
docx.p "sample text"
docx.img  get_presigned_url_from_blob(image.blob) do
      data    file_to_upload.read  # this returns binary data
      width   width 
      height  height 
      align   :left 
      top     5    
      bottom  5   
      left    10   
      right   10 
    end

I dont want to save the file created locally so I am directly uploading the generated contents on s3 with

s3_client.put_object(
      bucket: <BUCKET_NAME>,
      key: key,
      body: docx.render.string
    )

Am I using the gem correctly? or its the issue with latest version. I am using Rails 7 and Ruby 3.1.1

Note: generated doc is attached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant