Sub ConvertiPdfImg(nomefile As String)
Dim Render As PDFRenderer
Dim img As Bitmap
Render.Initialize("",Main.pthDOC,nomefile)
For i = 1 To Render.PageCount
img = Render.renderPageforDisplay(i)
' now save img in a file
Dim out AsOutputStream
out = File.OpenOutput(File.DirRootExternal, "page" & i & ".png", False)
b.WriteToStream(out, 100, "PNG")
out.Close
Next
End Sub