Question about erlguten and images

Emil Hellman <>
Thu Jun 22 16:08:35 CEST 2006


Hi!

I'm using erlguten to produce pdf's based on data stored in an mnesia
table. Getting erlguten to print out the information is real easy
using the functions in pdf.erl. However, I would now like to have a
little logo on my pdfs and here I have run into a problem.

In the code I'm using:

   PDF = pdf:new(),
   pdf:set_pagesize(PDF,a4),
   pdf:set_author(PDF,"Test"),
   pdf:set_title(PDF, "Test"),
   pdf:set_subject(PDF,""),
   pdf:set_keywords(PDF,""),
   {Y, M, D} = date(),
   pdf:set_date(PDF,Y,M,D),
   pdf:new_page(PDF),
   pdf:set_page(PDF,1),
   pdf:moveto(PDF, {50, 775}),
   pdf:image(PDF, "frs.JPG"),
   Serialised = pdf:export(PDF),
   file:write_file("test.pdf",[Serialised]),
   pdf:delete(PDF).


The pdf file gets generated, however, when I open the file in acrobat
reader I get the following message:

Could not find the XObject named 'Im1'.

I've tried to give the absolute path to the image file, but that had
no effect so I'm at a bit of a loss. I'm sure I've missed something,
but I can't find what it is. Should I call some other functions before
using pdf:image/2? Should I go about generating the pdf's in another
manner?

Thanks!
  - Emil



More information about the erlang-questions mailing list