I am using prawn and prawn html, when I using PrawnHtml.append_html(pdf, '<p style="display:inline;"><img height="26" width="26" src="path_image" >test</p>')
the image and text are not on the same line.
how can I make the image and text on the same line?
do you have any solution for that?
Welcome Devi!
Prawn explicitly states that it's not ideal for HTML rendering:
Prawn HTML has a similar warning:
So you probably don't want to turn HTML into a PDF using Prawn...
That aside, there are a few things wrong with your code:
displayis not one of Prawn HTML's supported CSS attributesheightandwidthshould be in the style attribute... from the readme:Looking at the supported tags I think the best you can hope for is to use absolute positioning but it doesn't seem to work with image tags. The text moves but the image goes where it would have gone.
Renders:

Even wrapping the
imgin an absolutely positioneddivdoesn't seem to work ♂️Unless you want to keep fighting against it I suggest you use one of the HTML alternatives Prawn and Prawn HTML suggest...
...or use Prawn natively. To get an image on the same line as text with Prawn you could write something like this:
Renders:
