Re: Does freemarker support images?

Wurzelseppi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi there,

i´m pretty new at JODReports and tried to integrate a picture in an odt
document.

Could anyone explain the steps needed to accomplish that?

1. How to prepare the odt template ? Do i need a ${...} where the picture
should be placed?
2. How to pass the picture to the template.create(...) method. I tried to
pass an InputStream but freemarker just made an toStringK() on that :-)


Many thanks in advance.


Greetings,


Stefan


Daniel Dekany wrote:
> 
> Tuesday, May 12, 2009, 12:09:43 PM, Shervin Asgari wrote:
> 
>> Sure, no problem.
>>
>> I can try to attach it here.
>> As far as I can see it seems like adding an image produces an
>> 'xlink:href' part in content.xml that links to the image and
>> freemarker for some reason tries to parse it as xml.
> 
> Ahhh... indeed, now I see it. *JODReports* tries to process that .jpg
> file with FreeMarker. Now that's a bug in JODReports for sure.
> FreeMarker itself doesn't try to do such thing alone. And the author
> of JODReports surely didn't mean to do this either, because he don't
> want to substitute anything inside images... so you have a JODReports
> bug here.
> 
>> But I am not sure. The problem could very well be in my application.
>>
>> Shervin
>>
>> Daniel Dekany wrote: 
>> Tuesday, May 12, 2009, 10:53:45 AM, Shervin Asgari wrote:
>>
>>   
>> Hello.
>>
>> I am using JODReports <http://jodreports.sourceforge.net/>
>> which is using Freemarker. I have an ODF template files and the template
>> file has an image. However I get freemarker exception:
>>
>> Token manager error: freemarker.core.TokenMgrError: Lexical error at 
>> line 157, column 81. Encountered: "\u0004" (4), after : "" in 
>> Pictures/100000000000011B000001AFCD845EED.jpg
>>
>> Can someone clarify please?
>>     
>>
>> Um... the thing is, there should be nothing special with inserting an
>> image; it's just done with plain XML tags like anything else in ODF.
>> But something seems to confuse the FreeMarker parser around the place
>> where the image happens to be... Could send the template attached? Or
>> if that's not possible, could you produce a minimal template that
>> reproduces the problem and send it attached?
>>
>>   
>>
> 
> -- 
> Best regards,
>  Daniel Dekany
> 
> 
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image 
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
> 
> 

-- 
View this message in context: http://www.nabble.com/Does-freemarker-support-images--tp23498721p26008390.html
Sent from the freemarker-user mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.