The following code tries to display a full-page PDF of text. IT either shows nothing or one or two words.
Am I overusing the sprite pdf capability? is there a max size for the pdf?
Thanks
displayMode(FULLSCREEN)
function setup()
spriteMode(CORNER)
page1l = image(400,600)
setContext(page1l)
sprite("Dropbox:Tikkun-01 3",0,0)
end
function draw()
sprite(page1l,0,0)
end
If it is due to the size of the PDF, you can try making a test PDF that is much smaller and uses only a few fonts. Let me know the results, I’m definitely curious to see how you get it to work. In the meantime I will continue to test this as well.
Yeah it really seems like converting to an image such as png or jpg is the way to go.
function setup()
pdfImage = nil
http.request("http://www.sciweavers.org/download/registration_form_1372951272.png", success)
end
function success(data, status, headers)
pdfImage = data
end
function draw()
background(20,20,40)
if pdfImage ~= nil then
sprite(pdfImage, WIDTH/2,HEIGHT/2)
end
end
I’d reached the same conclusion – I wanted to use the PDF because 1) we update the PDF from time to time, and I’d rather not have the extra step of making a jpg 2) I’d like to find some lua code to read the content of the pdf – something not possible with jpgs.
Some PDFs work, some don’t. The one’s that don’t have one dimension greater than 1000
I seem to recall some discussion of sprite size limit – @Simeon, does that apply to PDF size as well? Even when scaled down? (I.E. the sprite is 400x600, the PDF is 792x1224)
Ah, so it really does seem like saving as an image is the only way to go as of now. Trying to find a good website that can convert PDF to image on the fly by use of a single URL. Then you could call an http.request for each PDF and have an image returned to be drawn.
I’m using an iPad 1 - i dont know if that’s an issue…
Since pdfs are size independent I’m wondering why/how codea’s dropbox chooser determines the “size” of the image. From the internal thumbnail jpg? @Simeon?