SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to convert the pdf file to blob type ?


How to convert the pdf file to blob type ?

Author
Message
Charmer
Charmer
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3382 Visits: 1062
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
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)SSC Guru (65K reputation)

Group: General Forum Members
Points: 65162 Visits: 13298
You can use the Import Column task to import the PDF files into the database.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Charmer
Charmer
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3382 Visits: 1062
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
Charmer
Charmer
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3382 Visits: 1062
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
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36056 Visits: 16701
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
peterwalll
peterwalll
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 7
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 processI have another question, I wonder have you ever tried to convert pdf to other image files 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

aliaanderson27
aliaanderson27
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 0
Hope http://pdf-to-jpg-convert.en.softonic.com will helps you
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search