title: How to convert a series of images into one pdf document in php
body: <p>I have searched for a while and can not find a clear answer to this.</p>
  
  <p>I have a folder with images:
  001.png, 002.png ....etc.</p>
  
  <p>what I have tried.</p>
  
  <pre><code>$allImages = 'folder/001.png folder/002.png folder/003.png';
  //and
  $allImages = 'folder/001.png,folder/002.png,folder/003.png';
  //and
  $allImages = '-adjoin folder/001.png -adjoin folder/002.png -adjoin folder/003.png';
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>exec(convert $allImages folder/newdoc.pdf);
  //and
  exec(convert -density 150 -format pdf{} ".$all_images folder/newdoc.pdf);
  </code></pre>
  
  <p>This only puts one page into the pdf and the pdf has a header of png so it really is not readable by a pdf viewer.</p>
  
  <p>I do not want to use (convert *.png newdoc.pdf) as i need the pdf in a certain sequence. EDIT: this does not work either.</p>