because of the workload and I found automation using PAD, here I want to combine the pdf files from folder A and folder B then put them into folder C. in the order of pdf files from folder A above and pdf files from folder B below
The following is an illustration of the contents of folder, folder B, and folder C
Folder A
1234_SEP.pdf
1235_SEP.pdf
etc
folder B
1234.pdf
1235.pdf
etc
C folder
with the new file name 1234.pdf (1234_SEP.pdf above and 1234.pdf below)
I hope that makes sense, Thanks in advance for your help
this works fine
Thank you to all of you
sorry if it makes you confused
this works fine
Thank you to all of you
sorry if it makes you confused
Hi @lagibingung ,
In Merge PDF Files action, please reverse the variables.
FolderBfiles variable followed by FolderAFiles
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
Got it!
In the merge pdf action swap the variables. Now We have mentioned AFolderFiles[Counter].Fullname right. Now first place BFolderFiles[Counter].Fullname and move AFolderFiles to last.
I'm sorry, in folder A I forgot to change 1234SEP.pdf to 1234_SEP.pdf, maybe that's why there are no merged files in the output folder
now the pdf has been combined and named accordingly
The problem this time is, the pdf in folder A is located on page 2 while the pdf in folder B is located on the first page, can the mergedpdf feature on PAD make the pdf file in folder A located on the first page?
@lagibingung
Pls share screenshot of folder A and B if possible? I can assist you in more appropriate way by finetune my above code.
Hi @lagibingung ,
Both works bit similar. Just try my new updated solution.
If it doesn't work, we will see.
Let me know whether it worked or not.
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
Hi @lagibingung ,
Please find the solution for naming the file after merging.
Please copy the updated below code to your flow.
Code:
Folder.GetFiles Folder: $'''C:\\Users\\vr79540\\OneDrive - Cyient Ltd\\Desktop\\Power Automate Desktop\\Practice\\Combine PDFS\\Folder A''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> FolderA_Files
Folder.GetFiles Folder: $'''C:\\Users\\vr79540\\OneDrive - Cyient Ltd\\Desktop\\Power Automate Desktop\\Practice\\Combine PDFS\\Folder B''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> FolderB_Files
SET Counter TO 0
LOOP FOREACH CurrentItem IN FolderA_Files
Text.SplitText.SplitWithDelimiter Text: FolderA_Files[0].Name CustomDelimiter: $'''_''' IsRegEx: False Result=> TextList
Pdf.MergeFiles PDFFiles: $'''{ \"%FolderA_Files[Counter].FullName%\", \"%FolderB_Files[Counter].FullName%\" }''' MergedPDFPath: $'''C:\\Users\\vr79540\\OneDrive - Cyient Ltd\\Desktop\\Power Automate Desktop\\Practice\\Combine PDFS\\Folder C\\%TextList[0]%.pdf''' IfFileExists: Pdf.IfFileExists.AddSequentialSuffix PasswordDelimiter: $''',''' MergedPDF=> MergedPDF
Variables.IncreaseVariable Value: Counter IncrementValue: 1
END
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
can the script be made from the script @Deenuji described?
OK, thanks for the explanation, here I start to understand how your script works
Here there is a problem with the output folder after merging files, there are no merged PDF files there
WarrenBelz
146,653
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional