I successfully ran the script with my sample data. On my way I ran into these problems:
- the .csv file could not be imported into the InDesign template because there were invalid characters
- there were no placeholders defined in the InDesign template
- the output folder was missing
- the pdf Export preset was missing
Also, what happens, if you place more than one InDesign template or .csv in the folders
One of the above will be your problem, I guess.
I am sorry I did not ask the question properly.
The attached code does work on my system The template has the place holders already set. (We use this template already to produce about 100 thousand records a day with another system)
the .csv is routed through another routine before it is put in that folder to get rid of any bad characters. It also maps the headers to the placeholders.
The output folder is on my system
the preset is a preset on my system.
What I am asking is how do I produce Directly to a pdf not into memory.
When I try to produce 25 -35 thousand records it fills the memory and gets stuck.
Several plugins do not have this problem I am relatively certain that they are not merging directly into InDesign but into a pdf.
I figured it out.
myDocument.dataMergeProperties.exportFile(File("~/Documents/hotfolder/output/"+ jobNumber+"-proof.pdf"),"[Smallest File Size]",File("~/Documents/hotfolder/output/"+ jobNumber+"-proofoverset.txt"));