1

I have a question regarding the php file structure.

I want to run a script to genearte images of bunch of pdf files.

My problem is the actually pdf files are in different folders and structures.

For example:

a pdf could locate in

/test/book/pdf/test.pdf. 

another one could be in

/server/pdfs/link/dummy.pdf. 

There are thousands of pdfs file in the file system and I am using Imagick to generate the images from pdfs.

I am not sure how to locate all of the pdf nor how to specify the file path in imagick constructor.

 $im = new imagick('file path to pdf here'); //I don't know how to specify the file path here... $im->setImageFormat( "jpg" ); 

Can anyone gives me a hint? Thanks so much!

1

1 Answer 1

1

You could go up to the root folder and scan all the directories and their subdirectories for .pdf files and store them in an array (PHP: scandir), an array or a string with a caracter-delimiter between each filename.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.