Following is an interpretation of the above question.
By files, I mean the files that are uploaded to the Attachment field.
Ideally, I would like to have a parching function where a PDF file is uploaded to a record, and then the PDF file is separated into its pages, and each page is saved as a separate file in the same Attachment field.
We are more than happy to help debug or improve your existing code. Feel free to post specific questions or problems you have encountered as you are building Kintone customizations.
In this case, follow the template below and provide as much information as possible.
However, for requests on custom JavaScript implementations, please seek advice through the Kintone Partners page.
Developer Question Template
Question / Problem
Got an error message while building a JS customization?
Current Situation
How is your Kintone App configured? Screenshots of the Error Message are helpful.