Print Page | Close Window

Out of Memory error

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=925
Printed Date: 17 May 24 at 3:25AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Out of Memory error
Posted By: kyawkoko
Subject: Out of Memory error
Date Posted: 29 Jul 08 at 11:48PM
Hi everyone,

  i am using ised quick pdf to export pdf report in vb.net.For large pdf report,
i got out of memory error.Please help me.

Thanks,
Ko Ko

This is my sample code.

 For index = 0 To DataGridView1.RowCount - 1
                If (index Mod 45) = 0 Then
                    If index <> 0 Then
                        PDFnewGen.NewPage()
                    End If
                   
                    iPage = iPage + 1
                End If

                sTemp = DataGridView1.Rows(index).Cells(0).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)


                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(13, ((index Mod 45) + 6) * 5, 10, 5, PDFnewGen.GetSubsetString(sTemp), 0)


                sTemp = DataGridView1.Rows(index).Cells(1).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)
                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(35, ((index Mod 45) + 6) * 5, 40, 5, PDFnewGen.GetSubsetString(sTemp), 0)


                sTemp = DataGridView1.Rows(index).Cells(2).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)
                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(67, ((index Mod 45) + 6) * 5, 40, 5, PDFnewGen.GetSubsetString(sTemp), 0)


                sTemp = DataGridView1.Rows(index).Cells(3).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)
                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(110, ((index Mod 45) + 6) * 5, 30, 5, PDFnewGen.GetSubsetString(sTemp), 0)


                sTemp = DataGridView1.Rows(index).Cells(4).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)
                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(143, ((index Mod 45) + 6) * 5, 40, 5, PDFnewGen.GetSubsetString(sTemp), 0)


                sTemp = DataGridView1.Rows(index).Cells(5).Value
                PDFnewGen.AddSubsettedFont("Times New Roman", 11, sTemp)
                PDFnewGen.SetTextSize(8)
                PDFnewGen.SetTextAlign(0)
                PDFnewGen.DrawTextBox(183, ((index Mod 45) + 6) * 5, 40, 5, PDFnewGen.GetSubsetString(sTemp), 0)



                ProgressBar.ProgressBar1.PerformStep()



            Next index




Replies:
Posted By: DELBEKE
Date Posted: 30 Jul 08 at 7:37AM

Try to add the font once

PDFnewGen.AddTrueTypeFont("Times New Roman", 1)
PDFnewGen.SetTextSize(8)
PDFnewGen.SetTextAlign(0)
For index = 0 To DataGridView1.RowCount - 1
                If (index Mod 45) = 0 Then
                    If index <> 0 Then
                        PDFnewGen.NewPage()
                    End If
                   
                    iPage = iPage + 1
                End If

                sTemp = DataGridView1.Rows(index).Cells(0).Value
                PDFnewGen.DrawTextBox(13, ((index Mod 45) + 6) * 5, 10, 5,sTemp, 0)


                sTemp = DataGridView1.Rows(index).Cells(1).Value
                PDFnewGen.DrawTextBox(35, ((index Mod 45) + 6) * 5, 40, 5, sTemp, 0)


                sTemp = DataGridView1.Rows(index).Cells(2).Value
                PDFnewGen.DrawTextBox(67, ((index Mod 45) + 6) * 5, 40, 5, sTemp, 0)


                sTemp = DataGridView1.Rows(index).Cells(3).Value
                PDFnewGen.DrawTextBox(110, ((index Mod 45) + 6) * 5, 30, 5, sTemp, 0)


                sTemp = DataGridView1.Rows(index).Cells(4).Value
                PDFnewGen.DrawTextBox(143, ((index Mod 45) + 6) * 5, 40, 5, sTemp, 0)


                sTemp = DataGridView1.Rows(index).Cells(5).Value
                PDFnewGen.DrawTextBox(183, ((index Mod 45) + 6) * 5, 40, 5, sTemp, 0)



                ProgressBar.ProgressBar1.PerformStep()



            Next index



Posted By: Ingo
Date Posted: 02 Aug 08 at 6:53PM
Hi!
Please try first the latest version (not 5.11) here from our library section. Your old key is still valid.
best regards,
Ingo


Posted By: kyawkoko
Date Posted: 06 Aug 08 at 3:42AM
Thanks DELBEKE and Ingo for your's reply.I passed this problem by adding the font once.

KO KO



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk