Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Assemble an unknown number of pfd files programatically

Avatar

Former Community Member
Hi,



in the documentation example 2.7 - Exceuting a job request, we use a Document class object for each pdf file (2 files in the eaxmple) and insert it to a hash table.



in case there is an unknown nuber of PDF files to assemble, should i create a unique Document object for each, or can i use a single Document object and after insert it to the hash table, to use it for another pdf file (e.g. usign a "For" loop)?



thanks a lot,



Hagai
2 Replies

Avatar

Former Community Member
A Document object cannot be reused once initialized with a file or input stream. You should create a new Document for each input file.

Don

Avatar

Former Community Member
So, do you have an idea of how can i do it?

is there an option to seach a folder for all pdf files to merge (similar to watch folders, but using the API)?



thanks!

Hagai