Announcement

Collapse
No announcement yet.

Convert uploaded PDF file to Image using php exec & imagemagick

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert uploaded PDF file to Image using php exec & imagemagick

    Hi,
    Can we upload PDF file then convert to image to generate thumbnail?
    I'm trying to user imagemagick to complete this task.

    So far, i manage to use imagemagick via command line (conver a.pdf thumb_a.jpg).
    But not able to use execute it via php using exec on event on before process..


    this is my code:
    PHP Code:
    $nm_file $_SESSION['scriptcase']['form_test_file']['glo_nm_path_doc']."/".{file_uploaded};
    $nm_file_thumb $_SESSION['scriptcase']['form_test_file']['glo_nm_path_doc']."/thumb_".{file_uploaded};    
    exec("convert \"$nm_file[0]\" -flatten -colorspace RGB -geometry 200 $nm_file_thumb"); 
    Please help..

  • #2
    do you have to use php code to convert pdf to image, i have some C# and vb.net sample codes that can help you convert pdf to other image and document formats, besides it is able to generate thumbnail as well.
    good luck with your work, let me know if you need my help.

    Comment


    • #3
      If you can use it via a convert command via a commandline then it is likely that from within scriptcase it doesnt work because you do not have the rights to run convert. The scriptcase webserver has less rights then a normal user.
      I assume this is a linux box, if not then also try spelling you the full path for convert (or convert.exe which is then probably the actual name).

      Comment


      • #4
        PDF Converter allows you to convert any of your file format to PDF directly just by several mouse clicks.It is also very time-saving,for the total conversion process will only costs you a moment.You can set a password to protect your PDF files as well.Here I'd like to share with you a website,IfCoupons.com, where I can find many satisfying PDF Converter products.Go to get coupons of PDF Converter for discounting prices.

        Comment


        • #5
          Or use the free pdfforge as commandline program.... Talk about even cheaper...

          Comment


          • #6
            PDF Converter is a kind of software which can help us convert our PDF to Word, Excel, HTML and any other format you need.It also benefits our daily office job a lot.As we all know, the famous Adobe Acrobat PDF Converter has many awesome features,however it's really too expensive to afford for personal use.Next,I'd like to share with you some much cheaper but also professional PDF Converter provided on IfCoupons.com.This website offers coupons of PDF Converter for discounting prices.You can find many PDF Converter products from various brands and shops. Come to find the one meets your need.
            Last edited by VanessaGilbert; 10-24-2014, 12:09 AM.

            Comment


            • #7
              Originally posted by lucywill View Post
              do you have to use php code to convert pdf to image, i have some C# and vb.net sample codes that can help you convert pdf to other image and document formats, besides it is able to generate thumbnail as well.
              good luck with your work, let me know if you need my help.
              Hi, lucywill.
              Thanks for your nice sharing. I wonder do I need some toolkits to deal with the code you mentioned above?

              Comment


              • #8
                PDF protector enables you to encrypt your pdf file for long time. There are PDF passwords that can be removed easily. We thoroughly encrypt your files so that it would take many thousands of years to crack your password with a regular computer. You can save a lot time with this tool.http://download.cnet.com/Softaken-PD...-76487039.html

                Comment

                Working...
                X