Question about erlguten and images

Mikael Karlsson mikael.karlsson@REDACTED
Sat Jun 24 08:17:44 CEST 2006


Hi Emil,

I think you found a bug in an older version of  ErlGuten.

Can you see a section like:

1 0 obj
<<
/Type  /XObject 
/Subtype  /Image 
/Width  183 
/Height  300 
/Filter  /DCTDecode 
/ColorSpace  /DeviceRGB 
/BitsPerComponent  8 
/Length  17336 
>>


And a second after the image stream like:

2 0 obj
<<
/Im1  1 0 R 
>>

? Mikael

torsdag 22 juni 2006 16:08 skrev Emil Hellman:
> 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