The cause of this issue was VS2008. When i made a second copy of my code referencing pdfsharp, it worked! The first copy must have been corrrupted in some way and it prevented release of the source files. I can say for sure now that the issue is resolved.
I am trying to use pdfsharp to write a pdf that contains text and images. I was doing really well until I ran into a problem related to the source images not being released after creating the pdf’s using ximage.
I have read through the forum and this is a pervasive thread and I do not believe there is a good answer so far. It is suggested in the posts that version 1.5 takes care of the problem but I have upgraded to version 1.5 from 1.3 and can say that it did not help. The problem exists in 1.5 as well.
I am not a c# programmer so I am using the Nuget download of Pdfsharp-gdi.dll - Version 1.50.4619.0
My environment is vs2008 and my code is in vb.net. It looks like this
Dim s3image As XImage = XImage.FromFile("saved2.bmp")
gfx1.DrawImage(s3image, 20, 65, 241, 185) ‘add more elements to the pdf here‘ s3image.Dispose()
The above code works – the image is produced on the pdf. However, after running this code I can’t delete. rename or overwrite the ‘saved2.bmp’ because it is now locked.
Am I missing something? Or does anyone have a ximage.fromstream example I could follow? I can send an example vb.net project with this issue if that would be of help. It sounds like it is a well known issue in the community hopefully with a well known solution.
Last edited by miken99 on Thu Nov 09, 2017 3:13 pm, edited 1 time in total.
|