image in pdf

N

Nick

i do this and he cant find it

pdf.Image('/products/logo2.jpg',10,8,86,0,'JPG')

the folder and image is under C:\rails\eshop\public\images, or is this only
for the web, if so where to put it for the pdf?
 
A

Austin Ziegler

i do this and he cant find it

pdf.Image('/products/logo2.jpg',10,8,86,0,'JPG')

the folder and image is under C:\rails\eshop\public\images, or is this on= ly
for the web, if so where to put it for the pdf?

Um. Which PDF creator are you using? I'd guess that you're using FPDF
for Ruby; I'd personally recommend PDF::Writer, but I'm biased.

You will need to fully specify the path in any case, though, as the
Ruby program doesn't know anything about relative path from the web
root. You can potentially just specify
"public/images/products/logo2.jpg".

-austin
 
N

Nick

i get this error using fpdf

pdf.Image('public/images/products/PIDVR108.jpg',20,200,100,'JPG')

error:
undefined local variable or method `data' for
#<FPDF:0x3709a18>/lib/fpdf/fpdf.rb:1317:in `parsejpg'
/lib/fpdf/fpdf.rb:821:in `Image'
/app/controllers/product_controller.rb:41:in `gen_pdf'
/app/controllers/product_controller.rb:27:in `pdf'
script/server:49when i change the path to something else (i enter a wrong
path): then no such directory or file,so he find the file.anyone can help me
 
A

Austin Ziegler

i get this error using fpdf

pdf.Image('public/images/products/PIDVR108.jpg',20,200,100,'JPG')

error:
undefined local variable or method `data' for
#<FPDF:0x3709a18>/lib/fpdf/fpdf.rb:1317:in `parsejpg'
/lib/fpdf/fpdf.rb:821:in `Image'
/app/controllers/product_controller.rb:41:in `gen_pdf'
/app/controllers/product_controller.rb:27:in `pdf'
script/server:49when i change the path to something else (i enter a wrong
path): then no such directory or file,so he find the file.anyone can help=
me

Which operating system are you using?

Can you try the same thing with PDF::Writer (gem install pdf-writer)?
It's a different API, but the sort of message returned will be
informative. It's also clearly documented how to do headers and
footers in the 95-page manual.

-austin
 
N

Nick

i am using win xp pro, will try that, at first sight i was complexer than
fpdf but i give it a try, where can i get that 95 pg manual
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,517
Latest member
Andres38A1

Latest Threads

Top