I have created 6 documents in Visual Basic 4 which I programmatically print to Pdf24 from within a loop.
I need to autosave each individual pdf with a DIFFERENT FILENAME to the same folder.
I need to define each filename from within VB using a variable.
This is what I have done so far:-
In THE pdf24 Assistant settings I have :-
- Set PDF Printer Tool to "Automatically save documents after printed" (Under PDF Printer Tool)
- Set the Output Directory to C:\PDFs (Under Auto Save)
- Set the Filename entry to use the placeholders %Y, %m, %d, %H, M%, S% $filename (Under PDF Printer Tool)
ALL 4 documents are saved OK as PDF's but with the $fileName placeholder part of the filename being saved as "Microsoft Visual Basic" for all 4 PDF's ie. :-
- 1st. file saved as "2018-11-16 12-04-09 Microsoft Visual Basic.pdf"
- 2nd. file saved as "2018-11-16 12-04-10 Microsoft Visual Basic.pdf"
- 3rd. file saved as "2018-11-16 12-04-11 Microsoft Visual Basic.pdf"
- 4th. file saved as "2018-11-16 12-04-11 Microsoft Visual Basic.pdf"
What I need to do is to autosave all 4 files using my own filenames and without Date, Month etc. etc. I can't fathom how to do it using just the $fileName placeholder - unfortunately, using just this, each PDF is saved with the filename "Microsoft Visual Basic", which means that each previous file saved is overwritten by the next file saved.
Is it possible from within Visual Basic to use a variable to define a DIFFERENT filename for EACH INDIVIDUAL PDF as it is autosaved?
I would be extremely grateful for any help whatsoever.
PS. Does the $fileName placeholder take the filename from the application name which generates the PDF's hence the filename "Microsoft Visual Basic" ?
I think there is a simpler solution for your problem. Just use the PDF24-docTool.exe to convert your files to PDF. Use the following command line:
pdf24-DocTool.exe -convertToPDF [-profile profileId] -outputFile OUT FILE1 [FILE2]
This lets you specify the input file and the output file.
When you call the docTool without arguments on the command line, then the tool outputs all command line arguments.
Thank you for your reply Stefan.
I'm assuming that I would need to type this line for each of my PDF'd? If so then it's quite possible that I will need to do this in the future for many more PDF's and typing in this line for each PDF would be rather tedious.
Using Visual Basic then I could use a Loop to process all PDF's automatically. Within the Loop I could define the filename to save to for each PDF but it's finding a way to automate this assigning of filenames to each PDF and then saving them with their individual filename once they have been printed to PDF24 (using Autosave) that I am having difficulty with.
Examples of filename I would want to save to are:-
DKL007-Cavalier.pdf
CKs101-Russian-Blue.pdf
GW051-Paris.pdf
etc
etc
etc
The information for the output filenames I would take from the filenames of documents which I merge from within Visual Basic before printing to PDF.
Hope this is easy to understand. Don't know if you can help me further but I do thank you for taking the time to address my problem.
regards
I have just realised that the top line should have read "I have created 6 documents in Visual Basic 6 which I programmatically print to Pdf24 from within a loop."
I had put Visual Basic 4 when I meant Visual Basic 6.
I'm hoping that's the reason I haven't had any suggestions so far. Hope someone can help. Many thanks.