I am using reportLab to generate a pdf report. I downloaded a PNG from the internet and I created a PNG using R. In my viewer I can open both images. When I create a pdf I can add the image that I got from the internet to the PDF but I can't add the image I created using R (it just shows up as a black box). Why does canvas draw one but not the other? How do I trouble shoot this problem?
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, landscape
c = canvas.Canvas("Test.pdf", pagesize=landscape(letter))
c.drawImage("MYRGeneratedImage.png",0,0) #This wont work
c.drawImage("logo.png",350,50) #This works
c.showPage()
c.save()
I can't add images because I don't have 10 reputation points. However the png that is working can be found here: http://www.unixstickers.com/image/cache/data/stickers/python/xpython.sh-340x340.png.pagespeed.ic.fbORd6iZuV.png
and I can't get on any image hosting websites because I am at work so here is R code to create an image:
data <- c(1,2,3,4,5,4,3,2,1)
png(file="MYRGeneratedImage.png", bg="transparent")
hist(data,main="Test Diagram")
dev.off()