Print to PDF from Safari or Chrome

Hi
I am trying to use Safari to Print as PDF several files located in one folder.
The folder structure is as follows:
/folderwrk
A.html
B.html
C.html
D.html
etcetera
inside this folder there is another folder with images
Images
1.jpg
2.jpg
3.jpg
4.jpg
etcetera
The A.html page looks for the 1.jpg image inside the Images folder to display it

How to create an Applescript to:
1 find a folder in my drive
2 define a destination folder
3 Tell Safari to print as PDF
4 Select every file in the found folder
5 Print them in the destination folder with the PDF extension?

Regards and thanks to anyone willing to help.

Model: MAC PRO 4.1 32GB RAM ans SSD disk
Browser: Safari 537.36
Operating System: Mac OS X (10.10)

Just two questions
(1) What need to use a browser to print pictures into PDFs documents ? Isn’t it more logical to use Preview ?
I would have understand if Safari gave the ability to do the job without triggering GUI scripting but as far as I know, it doesn’t.
(2) My understanding is that the path to the folder containing the jpegs is : /folderwrk/Images/
Am I right ?

Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) dimanche 20 mars 2016 13:54:01

Thanks
1st question
The 1508 files I need to convert are in html

After doing several tests I learned that exporting to PDF doesn’t help me. So I should simply delete this post.

Even if I was able to convert them the resulting PDF files keep clicable images and the links but don’t allow editing. I need to be able to edit and post back the files for my students.

After several different tests with these files and various conversions:

The best option for what I need to do is wrap a textutil conversion option from html to rtdf in an Applescript.

I found some scripts who do so but they do it for one file at the time as such:

set a to choose file
set b to POSIX path of a
do shell script "textutil -convert rtfd " & b

However it would be great if I could choose a folder rather than a file and run a loop for every files inside that folder-

Doing it one by one is a very tiring stuff although it finally givbes me what I need for this task.

All this because a severe power failure destroyed my 2 back up hard drives where all this work was done already,

Thanks