PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OutofMemoryException

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
Patroni



Joined: 05 Jun 2009
Posts: 3

PostPosted: Tue Jun 09, 2009 10:09 am    Post subject: OutofMemoryException Reply with quote

Hey guys i need your help.
So i'm making a projecto that will create a pdf from the images that people scan. So now I'm on my final tests and i check an error that i don't understand...

I get the error OutOfMemoryException error just in some cases depending on the location of the images file.
I was testing choosing the images files for exemple (C:\Documents and Settings\mp\Desktop\teste) that had 5 jpg images and i created the pdf file in another location and it was ok no error no nothing.
Then i tryed puting the images files in (C:\Inetpub\wwwroot\scanner\images) and tge pdf file in some other location and i got error can you guys help me out figure where the problem is?

My function code is this

Code:
Protected Sub ButtonConvert_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonConvert.Click

        Dim source As String
        Dim pdfPath As String
        Dim i As String = 0

        pdfPath = directorioPdf.Text + ".pdf"
        source = directorioImagens.Text
        ''''criar o pdf
        Dim myPDF As PdfDocument
        myPDF = New PdfDocument()

        If Directory.Exists(source) Then
            ''''ciclo percorre todos os ficheiros do folder
            For Each fName As String In Directory.GetFiles(source)
                If File.Exists(fName) Then
                    Dim dFile As String = String.Empty
                    dFile = Path.GetFileName(fName)
                    Dim dFilePath As String = String.Empty
                    dFilePath = source & dFile
                    ''''coloca a imagem na pagina correspondente
                    Dim xgr As XGraphics
                    myPDF.Pages.Add(New PdfPage())
                    xgr = XGraphics.FromPdfPage(myPDF.Pages(i))
                    Dim myImage As XImage = XImage.FromFile(fName)
                    xgr.DrawImage(myImage, 0, 0)
                    xgr = Nothing
                    myImage = Nothing
                    i = i + 1
                End If
            Next
        End If

        ''''Salvar pdf
        myPDF.Save(pdfPath)
        myPDF = Nothing
        ''''mostrar resultado ao utilizador
        resultado.Text = ("A aplicação criou o pdf correctamente")
    End Sub
End Class
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com