Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - VB6 - Merge List File
  FAQ FAQ  Forum Search   Register Register  Login Login

VB6 - Merge List File

 Post Reply Post Reply
Author
Message
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post Topic: VB6 - Merge List File
    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



Edited by Cuspide - 04 Jul 11 at 4:16PM
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post 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


Edited by Cuspide - 05 Jul 11 at 10:01AM
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Cuspide View Drop Down
Team Player
Team Player


Joined: 25 May 10
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cuspide Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store