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!
VB6 - Merge List File |
Post Reply |
Author | |
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
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 |
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
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?
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
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 |
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
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
|
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
Hi Rowan I no longer receive your reply...do you recommend something to increase the performance of merge? Many Thanks
|
|
Wheeley
Senior Member Joined: 30 Oct 05 Location: United States Status: Offline Points: 146 |
Post Options
Thanks(0)
|
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 |
|
Cuspide
Team Player Joined: 25 May 10 Status: Offline Points: 21 |
Post Options
Thanks(0)
|
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
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store