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

Can't render images on the document #80

Open
eviofragoso opened this issue Aug 14, 2019 · 7 comments
Open

Can't render images on the document #80

eviofragoso opened this issue Aug 14, 2019 · 7 comments

Comments

@eviofragoso
Copy link

I'm trying to render images on the docx, but with no success. I even tried with the example in the readme and the images just dont appear.

The image html i'm trying to render is:
<p style='text-align: center;'><img src=\"http://placehold.it/250x100.png\" style=\"width: 250px; height: 100px\"></p>\n ... rest of the html.

using this call in the controller:
render docx: "document.docx", content: document_html

I'm using the 1.1.0 version of the gem, with 5.0.2 rails version.

@TiagoHenriqueMoraes
Copy link

+1

@jcat4
Copy link

jcat4 commented Oct 30, 2019

+1 as well...

@anitsirc
Copy link

anitsirc commented Nov 8, 2019

@eviofragoso could you share more details?

Just tried

content = "<p style='text-align: center;'><img src=\"http://placehold.it/250x100.png\" style=\"width: 250px; height: 100px\"></p>"
render docx: "test-file", content: content

And seems to be working fine

Screenshot 2019-11-08 at 18 27 26

@HugsDaniel
Copy link

Hi folks, any progress on this issue ? I encounter the same, no way to display images even with all the required style and data tags.

@jcat4
Copy link

jcat4 commented May 19, 2022

Hi folks, any progress on this issue ? I encounter the same, no way to display images even with all the required style and data tags.

Unfortunately, I don't think we found a solution to this problem using this gem. We ended up parsing the HTML with Nokigiri and building a docx file with caracal. A little more involved, but.... It works! 👍

@adamreisnz
Copy link

I can confirm that even using the placeholder image code as suggested above by @anitsirc , no images are rendered in the DOCX file output.

@mohamed-ali-agourram
Copy link

mohamed-ali-agourram commented Oct 9, 2024

I can confirm that even using the placeholder image code as suggested above by @anitsirc , no images are rendered in the DOCX file output.

Hi did you find any solution for this yet?

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

No branches or pull requests

7 participants