Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need to display an image on the PDF, which will depend on characteristics of the view, but am currently unable to do so. What I have is below - the text "Look here!" prints well, but the image never does.
Should this be working, or is there an alternative way to include images in the PDF?
if($variable==1) {
print "Look here! <img src='http://www.mysite.com/redbox.JPG'>";
} else {
print "Look here! <img src='http://www.mysite.com/bluebox.JPG'>";
}
Comments
Comment #1
maxplus CreditAttribution: maxplus commentedHi,
I'm using version 7 of Views PDF and the only way I managed to display an image is to use another PDF as background template.
Images from fields from some content are also not appearing on my viewsPDF generated PDF...
Does anybody know how to display a image field on the viewsPDF generated PDF?
Comment #2
hessam61 CreditAttribution: hessam61 commentedYou can just add an image field to your views, and set the formatter to image, and Views PDF should be able to render it as HTML on PDF.
Comment #3
HeathN CreditAttribution: HeathN commentedI am doing a webform view and can't add image fields, why can this not render HTML image tags and display them? Is this a bug?
Comment #4
killua99 CreditAttribution: killua99 commentedDear fellow Drupal enthusiasts,
I have set this issue to "Postponed (Maintainer needs more information)".
If not already done please add an issue summary and steps how to reproduce the problem.
And please read again, "Making an issue report".
Help about how to do this can be found on IRC and in the user groups.
After there is new information, please re-open the issue by changing the status to active.
--
This issue was edited with the help of Issue Helper
Comment #5
Rustan CreditAttribution: Rustan commentedAnyone having issues with image, this seems like the best solution.
Comment #5.0
Rustan CreditAttribution: Rustan commentedslight correction