#1
|
|||
|
|||
![]()
I have a large file with 5000 records that I would like to have chunked into 250 records per output pdf.
What code do I need so that when outputting files it adds the starting and ending record of that chunk on the output pdf. For example: Output Job 1-250.pdf Output Job 251-500.pdf Output Job 501-750.pdf Thanks, Jeremy
__________________
Jeremy Acrobat Pro DC 2017 FusionPro VDP Creator 10.0.16 Mac OS X 10.11.6 |
#2
|
||||
|
||||
![]()
I think you'd basically just have to name output file the current record (i.e. 1) and then add on the chunk size (i.e. 250) when you're naming the file. Where are you setting the chunk size? If it's in the code, you might do something like this:
OnRecordStart Code:
var chunkSize = 250; var curr = FusionPro.Composition.inputRecordNumber; var outputName = "Output Job " + curr + "-" + (curr + (chunkSize-1)); //return outputName // Output Job 1-250; if (FusionPro.Composition.inputRecordNumber % chunkSize == 1){ FusionPro.Composition.OpenNewOutputFile(outputName + "." + FusionPro.Composition.outputFormatExtension); } Code:
var chunkSize = Int(FusionPro.Composition.JobOptions["RecordsPerChunk"]); var curr = FusionPro.Composition.inputRecordNumber; var outputName = "Output Job " + curr + "-" + (curr + (chunkSize-1)); //return outputName // Output Job 1-250; if (FusionPro.Composition.inputRecordNumber % chunkSize == 1){ FusionPro.Composition.OpenNewOutputFile(outputName + "." + FusionPro.Composition.outputFormatExtension); }
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#3
|
|||
|
|||
![]() Quote:
The job I am working on has 5076 records so the last pdf output is labelled 5001-5250. Is there a way to have it labelled by the last record in the output pdf? Jeremy
__________________
Jeremy Acrobat Pro DC 2017 FusionPro VDP Creator 10.0.16 Mac OS X 10.11.6 |
#4
|
||||
|
||||
![]()
You can do a check to see if the chunk is going to be less than the total number of records. If it is, use the chunk size. If it isn't, you know you're at the last chunk and you should just use the total number of records instead:
Code:
var chunkSize = Int(FusionPro.Composition.JobOptions["RecordsPerChunk"]); var curr = FusionPro.Composition.inputRecordNumber; var totalRecords = FusionPro.Composition.totalRecordCount; var range = curr + (chunkSize-1); if (range >= totalRecords) { range = totalRecords; } var outputName = "Output Job " + curr + "-" + range; if (FusionPro.Composition.inputRecordNumber % chunkSize == 1){ FusionPro.Composition.OpenNewOutputFile(outputName + "." + FusionPro.Composition.outputFormatExtension); } Code:
FusionPro.Composition.forcePreprocessing = true;
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|