No announcement yet.

Convert PDF to image and store in database

  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert PDF to image and store in database

    Can anyone point me in a direction. I've never worked with PDF's and don't really know where to start here. I have to pull PDF files from an sftp site, convert them to an image format and store them in an MSSQL database IMAGE datatype column. Is there anything built into Mirth to handle this or can anyone recommend an open source library that they've used in Mirth to do anything similar?


  • #2
    Mirth can help you get the PDF files and send the results to the database, but mirth itself doesn't have anything to do the conversion.

    A quick search says that the IMAGE data type is bring removed and varbinary(max) should be used instead.

    There are a couple pdf libraries that already come with mirth that might be helpful. Which image format do you need to convert to (jpg, png, etc...?)

    You'll probably get the best results by searching "convert pdf to xxx in java"


    • #3
      Also, not all image types support the concept of pages. I'd curious to know why a conversion from an arguably pretty good transportable format (although not perfect), makes sense.

      I'd probably do this all in a bash script and not mirth given the plethora of command like utilities for image conversion in Linux at least. It's probably about 10 lines of code in bash to get all the files from SFTP, convert them and "upload" them to SQL.
      Diridium Technologies, Inc.


      • #4
        Thanks for the input. The pdf's can be converted to pretty much any image type (jpeg, png probably best for this). The reason is it's an old legacy app that can display images, and not pdf's.The database schema is not under my control I'm afraid.


        • #5
          Have you tried any kind of software for this? You may find numerous online converters where you can format PDF files in a second and for free.
          Specify please, cause this way it`ll be clearer what to advise. Strange that this raises a question for you...Well, I always use this resource image enhancer online. it also has handy editing tools if you need them. I came across this program by accident. At that time I was just looking for one that can do more than paint. But later, after learning what features this one has, I realized it`s almost on an equal level with the acclaimed photoshop!
          Last edited by Lanoyolar; 11-01-2021, 08:29 AM.