On Thu, 30 Dec 2004 12:06:43 +0100, Leurs, Maarten (NL - Amstelveen) wrote:

> Hi,
> 
> First of all I want to tell you that I like iTextDOTNet very much, it is a 
> very usefull program. 
> I've just updated my version to your latest iTextDOTNet version 1.1.2-1. 
> After reading some documentation I saw that the RTFWriter I use to create RTF 
> documents is obsolete and is replaced by RTFWriter 2. Now comes the problem. 
> 
> If I creates an RTF document containing an image(retrieved from a file) with 
> the RTFWriter nothing goes wrong, but if I do the same with the RTFWriter2 
> something went wrong. Thus I create an RTF document with an image which I 
> retrieve from a file. After the image is added to the document I wants to 
> remove the image, using RTFWriter, this is no problem, but with the new 
> RTFWriter2, the process doesn't release a lock(?) on the used image. Below is 
> the code I use:
>         Dim tmpFile As String = IO.Path.GetTempFileName
>         If Not (tmpFile = "") Or imageOfModel Is Nothing Then
>             imageOfModel.Save(tmpFile, Drawing.Imaging.ImageFormat.Jpeg)
> 
>             Dim img As Image = Image.getInstance(tmpFile)
> 
>             Me._document.add(img)
>             Me._document.add(New Paragraph)
> 
>             If IO.File.Exists(tmpFile) Then
>                 IO.File.Delete(tmpFile)               <-- this goes wrong 
> using RTFWriter2, but not when using RTFWriter
>             End If
>         End If

Have you tried adding 

img.Dispose() 
img = Nothing

between right after adding the new paragraph?



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to