How to convert the pdf file to blob type ?

  • Hi Friends,

    I have a folder which contains thousands of pdf files where i have to convert into a blob file into a table. I have another table called Document which contains three columns called DocName and Doctype and fileSource.

    The files in the directory is always named as like as the same name in the Document table.

    For exapmle a pdf file holding the name called 15003786.pdf ...Exactly the same way we can see in the document table under DocName column. So my need is to look up for the names in the document table and process the matched files from the directory and convert it to blob data and insert into another table.

    FYI I don't want to open the pdf document. I just want to convert it into a blob data.

    Any suggestion woud be really appreciated. Help me friends..

    Thanks,
    Charmer

  • You can use the Import Column task to import the PDF files into the database.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (12/18/2012)


    You can use the Import Column task to import the PDF files into the database.

    Yes Koen, I am using the import column component....but the task gets failed when a file is unavailble in the directory if it is specified in the table. How to avoid such cases?

    A file name can be specified in a table where it may or may not be availble in the directory...So i need to skip if the file is not available and move to the next file....

    Thanks,
    Charmer

  • Koen, FYI

    "INSERT INTO [dbo].[Doc_Stage](DocName,DocPath,DocType) VALUES ('" +REPLACE(RIGHT(@[User::FilePath],FINDSTRING(Reverse(@[User::FilePath] ) ,"\\", 1)-1),RIGHT(@[User::FilePath],4),"")+ "','" + @[User::FilePath] + "','" + RIGHT( @[User::FilePath] ,FINDSTRING( REVERSE(@[User::FilePath] ),".",1)-1)+ "');"

    I googled and found the above method of inserting the document name. I use this statement to insert the file name dynamically using a for loop containser and execute SQL task.....but this statement is not validated by the expression of execute sql task....could you help me please...?

    Thanks,
    Charmer

  • Charmer (12/18/2012)


    the task gets failed when a file is unavailble in the directory if it is specified in the table. How to avoid such cases?

    Two options:

    (1) Do a file existence check for each file, using xp_fileexist, a DOS command, a VB script, Powershell or however else you like to do it.

    (2) Import the file list into a staging table and join that to your table of files so that you get a list that only includes files that exist.

    John

  • Hi, Charmer.

    I have seldom tried to convert into a blob file into a table. I wonder have you worked it out? Do I need another 3rd party manual toolkit? When it comes to PDF converting process[/url]I have another question, I wonder have you ever tried to convert pdf to other image files[/url] before? As for myself, I am testing the related PDF to PNG converting , PDF to BMP converting , and PDF to JPG converting programs these days. Do you have experience about it? Any suggestion will be appreciated. Thanks in advance.

    Best regards,

    Pan

  • Hope http://pdf-to-jpg-convert.en.softonic.com will helps you

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply