Merge PDF files by ascending file name

Hi there!

Could you help me to merge PDF files by ascending file name?

Now I’m using Join PDF files activity and I use Directory.GetFiles() it’s not ascending file name

Please give me some suggestion or new solution to merge PDF file by ascending file name

Thank you so much

Hi @Nattawadee_Srisai

Give a try with

Directory.GetFiles(FolderPath,“*.pdf”).OrderBy(Function(c) c).ToArray

Regards

Hi,

Is there any rule regarding sorting?
Simply the following will work.

files = System.IO.Directory.GetFiles(strPath,"*.pdf").OrderBy(Function(f) System.IO.Path.GetFileNameWithoutExtension(f)).ToArray

Then use Join PDF activity.

Sample20230224-5L.zip (79.2 KB)

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.