Where to integrate this code?

I’m working with this:

to see if I can add the ability to upload a pdf to the PHPmotion script (http://demo.phpmotiontemplates.com/default/),
(which currently only allows jpg, png & gif image uploads).

The part I need help with is where to integrate this code:

<a href="/pdf/myDocument.pdf" title="View This PDF File">
<img src="/scripts/pdf2jpg.php?src=pdf/myDocument.pdf" width="250" alt="PDF Document" />

into the attached file?inner_upload_image.txt (12.7 KB)

Which part of this are you trying to insert the image? Generally speaking, you should be able to just put “/scripts/pdf2jpg.php?src=pdf/myDocument.pdf” in wherever the current code wants an image location.

By checking this code, it appears to me that the script pdf2.jpg.php takes a parameter. This parameter is the PDF for which you want to create a thumbnail.
In your example, you would create a thumbnail for the pdf myDocument.pdf in the PDF directory:


so… the script /scripts/pdf2jpg.php is called with the parameter src=pdf/myDocument.pdf. It will then generate a JPG thumbnail.

The <a href…> part is the link. So, this code is generating an image that will be displayed on the page with <img src=…>. Then, around, you have a link to your original PDF with the tag <a href…>.

In the end, this simple could should display a thumbnail of your PDF and also open your PDF when you click on the thumbnail… To answer your question, you put that code anywhere in an HTML page where you want this image to be shown.

Thanks for the replies. Very helpful.
So, I guess now I need help getting this file(attached) to work with the inner_upload_image file that I attached to my original post.
Any additional guidance will be greatly appreciated.pdf2jpg.txt (3.0 KB)