Print Page | Close Window

VB6 - Merge List File

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=1876
Printed Date: 22 Nov 24 at 8:08PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: VB6 - Merge List File
Posted By: Cuspide
Subject: VB6 - Merge List File
Date Posted: 04 Jul 11 at 4:12PM
Hi all,
I and my company we're trying to see if Quick Library can be a useful tool for pdf creation.

I ask you a question

Suppose you need to print 1500 models, starting with a template already precompiled.

the code that we used is as follows:

        For iC = 1 To 1500
                    
            DoEvents
            Call opdf.LoadFromFile(FileName)
            sTmp = "C:\PROVA\PDF_" & iC & ".PDF"
                                                                        
            For iField = 1 To opdf.FormFieldCount
                sFieldName = opdf.GetFormFieldTitle(iField)
                If opdf.GetFormFieldType(iField) = 1 Then
                    Select Case UCase(sFieldName)
                        Case "CAMPO1"
                            Call opdf.SetFormFieldValue(iField, "TestX" & iC)
                        Case "CAMPO2"
                            Call opdf.SetFormFieldValue(iField, "TestY")
                        Case "CAMPO3"
                            Call opdf.SetFormFieldValue(iField, "TestZ")
                        Case "CAMPO4"
                            Call opdf.SetFormFieldValue(iField, "TEST")
                    End Select
                End If
            Next
            
            For iField = opdf.FormFieldCount To 1 Step -1
                Call opdf.FlattenFormField(iField)
            Next iField
                                    
            If opdf.SaveToFile(sTmp) = 0 Then
                MsgBox ("OK")
            End If
            
            Call opdf.AddToFileList("LIST", sTmp)
            
             If iC Mod 100 = 0 Then
                Call opdf.MergeFileListFast("LIST", "C:\PROVA\PIPPO.PDF")
             End If                                                                                                       
            Call opdf.RemoveDocument(opdf.GetDocumentID(pDoc))
            Call opdf.RemoveDocument(opdf.GetDocumentID(pDoc + 1))                                                                                                                              
        Next iC


We noticed that the program works so dear, but at the moment is the merge of files created previously puts us a long time

Is it possible to make this work better?
Thanks to all




Replies:
Posted By: Rowan
Date Posted: 04 Jul 11 at 9:55PM
Just to confirm -- is the problem you are experiencing that the merging of the PDF files is slow? If so, how slow is it? Do you have sample PDFs that you can upload?


Posted By: Cuspide
Date Posted: 05 Jul 11 at 9:59AM
Hi Rowan,
the problem occurs when I run the Merge, which is inside the for execute MergeFileListFast, or it must be outside For execute MergeFileList.

This is the file, create a pdf that contains only the first 3 pages and uses the first 3 pages as a template

http://www.agenziaentrate.gov.it/wps/wcm/connect/81e16c80457cc2d4b78cff10854b5983/770+2011+Semplificato+modello.pdf?MOD=AJPERES&CACHEID=81e16c80457cc2d4b78cff10854b5983

I await your reply.
Thanks.

PS: I forgot to tell you: the size of the model is 700kb


Posted By: Cuspide
Date Posted: 05 Jul 11 at 12:04PM
I noticed that using the optimization of adobe I recovered 300 KB, this is not bad, but the Merge after a number of modules begins to slow


Posted By: Cuspide
Date Posted: 06 Jul 11 at 8:12AM
Hi Rowan
I no longer receive your reply...

do you recommend something to increase the performance of merge?

Many Thanks


Posted By: Wheeley
Date Posted: 07 Jul 11 at 6:31AM
Why don't you do the merge after the loop? Based on the code, it would make sense to only merge once, after you have created the 1500 individual files first. If you read the function reference it says it merges ALL files in the list. So your code is constantly re-merging the same file over and over again. You should either merge once after the loop or create multiple partial merge files and then merge then at the end.

Wheley



Posted By: Cuspide
Date Posted: 07 Jul 11 at 8:48AM
I also tried to use the merge at the end of the cycle, but the time it takes to shrink all files is around 3 minutes; so now I'm trying to work with Acrobat to drastically reduce the size of the PDF, to guarantee to merge to work better

Thanks to all



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